Go4Expert (http://www.go4expert.com/)
-   JavaScript and AJAX (http://www.go4expert.com/forums/javascript/)
-   -   background color change problem (http://www.go4expert.com/forums/background-color-change-t8120/)

Lief Webster 6Jan2008 05:31

background color change problem
This is my first time using JavaScript, and I found a tutorial online to learn off of. Here is the code I have made, meant to make three buttons, each of which change the background color of the window.




function BgColor (color) {
document.bgColor=color }


<input type="button" name="redbutton" value="Red" onClick="changecolor ('red')">

<input type="button" name="bluebutton" value="Blue" onClick="changecolor ('blue')">

<input type="button" name="greenbutton" value="Green" onClick="changecolor ('green')">


The problem is, whenever you hit a button, nothing at all happens. Any help, please?

pradeep 6Jan2008 11:44

Re: background color change problem
Just look at your silly mistake dude, check the name of the defined function and the one you are calling!!

All times are GMT +5.5. The time now is 19:06.