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
Hi,

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?

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


tj111
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"
  3.  
Nov 29 '07 #2

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

Post your reply

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