28
rated 0 times
[
32]
[
4]
/ answers: 1 / hits: 193297
/ 11 Years ago, thu, june 20, 2013, 12:00:00
I am having a tough time with this javascript code to change the background color of a text input if the input is empty.
Here is the code:
function checkFilled() {
var inputVal = document.getElementById(subEmail).value;
if (inputVal == ) {
inputVal.style.backgroundColor = yellow;
}
}
Example: http://jsfiddle.net/2Xgfr/
I would expect the textbox to come out yellow at the beginning.
More From » text