786snow
Programmer
- Nov 12, 2006
- 75
How can I use javascript and css to change the background color of my text box
I tried the following that did not work
the following work but I wanted to do it using css
I tried the following that did not work
Code:
.textHilight {
background:00BFFF;
}
<input type="text" class="textbox" name="toDate" id="toDate" size=10 maxlength=10 value=>
document.getElementById('toDate').class= textHilight;
the following work but I wanted to do it using css
Code:
document.getElementById("toDate").style.backgroundColor = "#dd0000";