Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to change a button's color in NS

Status
Not open for further replies.
Apr 27, 1999
705
US
I am trying to change a button's color with javascript. The code works in IE but I believe it doesn't work in NS. Anybody have any ideas. Thanks,

Fengshui1998
-------------------
<html>
<body>
<form name=&quot;f1&quot;>
<input type=&quot;button&quot; name=&quot;btn&quot; value=&quot;red&quot; style=&quot;background-color:red&quot;

onclick=&quot;dothis()&quot;>
</form>
</body>

<script language=&quot;javascript&quot;>
function dothis() {

if (document.f1.btn.value==&quot;red&quot;){
document.f1.btn.value=&quot;green&quot;
document.f1.btn.style.backgroundColor='green'
return
}

if (document.f1.btn.value==&quot;green&quot;){
document.f1.btn.value=&quot;red&quot;
document.f1.btn.style.backgroundColor='red'
return;
}
}
</script>
</html> [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top