I am trying to change the color of a submit button when the value of a text box is changed. Can't seem to figure this one out. Any help would be appreciated.
You can do what you want by changing the "style" property of you button. For exemple, if you button id attribute value is "SubBtn", This example will change it's background color to red when clicked :
Code:
<Script>
function test() {
var oBtn=document.getElementById("SubBtn");
oBtn.style.background = "#FF0000";
}
</Script>
...
<input type="submit" id="SubBtn" value="test" onclick="test();"/>
Water is not bad as long as it stays out human body ;-)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.