Hello everyone,
This is a practice script and is not meant for real world use.
I can't get this to work. The code is suppose to change the background color of the div tag.
Any ideas?
Thanks!!Code:<script type="text/javascript"> <!-- function changeColor(){ var divTag = document.getElementsById("div"); for (var counter = 0; counter < divTag.lenght; counter++){ divTag[counter].style.background = "#FF0000"; } } //--> </script> </head> <body> <div style="width: 200px; height: 200px;">I love soupterines</div> <input type="button" value="Change Color" onclick="changeColor()" /> </body>
Novice2010







Bookmarks