By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,475 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

How to change background color of an HTML input field on content change..??

P: 4

I have an input field and I have to change the background color when the contents change.
The contents are changed by a pop-up. On submit of the pop-up the contents change.How can I change the input background color?

Nov 29 '07 #1
Share this Question
Share on Google+
2 Replies

P: 12
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('input_id_here').style.backgroundColor = "red";
  2. //dunno why its putting the space in "background"
Nov 29 '07 #2

P: 428
Expand|Select|Wrap|Line Numbers
  1. input_reference.onchange=function(e){
  2.     e= window.event? event.srcElement:;
  3. = "red";
  4. }
Nov 29 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.