Forum : regarding background color
Brief description  about Online courses   join in Online courses
View SARITA  DUBEY 's Profile

regarding background color

i am trying to change the background color using foll.. syntax....but its not working...

is there any mistake??

<html>
<head>
<title> Button</title>
<script Language="JavaScript">
</script>
</head>
<body>

<input type="button" value="red" onClick="document.bgcolor='red'">

</body>
</html>
Please reply.. thanks
Asked by SARITA DUBEY | May 26, 2010 |  Reply now
Replies (2)
View teacher siliconindia 's Profile
Hi Sarita,

change 'bgcolor' to 'bgColor'
May 28, 2010
View saumyajit chakraborty 's Profile
create a function in between the script tag and give the background syntax inside the function and then on the "onClick" part call that function name...!!!!
May 27, 2010