Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
184
rated 0 times [  185] [ 1]  / answers: 1 / hits: 17631  / 14 Years ago, thu, july 1, 2010, 12:00:00

Can someone show me whats wrong with this:



<html>

<script type = text/javascript>
function colourGreen()
{
document.getElementById(button1).style.bgColor = 0xFFFF00;
}
</script>
<body>

<form action=>
<div id = button1>
<input type=button value=Colour>
</div id>
<div id = button2>
<input type=button value=Price up onclick = colourGreen()>
</div id>
<div id = button3>
<input type=button value=Price down>
</div id>
</form>

</body>
</html>

More From » javascript

 Answers
2
document.getElementById(button1).style.backgroundColor = '#FFFF00';

[#96360] Tuesday, June 29, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cruzs

Total Points: 710
Total Questions: 113
Total Answers: 100

Location: Nepal
Member since Sat, Jul 18, 2020
4 Years ago
cruzs questions
Thu, Nov 26, 20, 00:00, 4 Years ago
Wed, Oct 28, 20, 00:00, 4 Years ago
Wed, Aug 19, 20, 00:00, 4 Years ago
Sun, Aug 2, 20, 00:00, 4 Years ago
;