Help me find out what went wrong...._html/css_WEB-ITnose
I did a small exercise and wanted to change the background color of the menu item every time the mouse slides over it. Why has there been no change....The code is as follows:
"http://www.w3. org/TR/xhtml1/Dtd/xhtml1-transitional.dtd">
<script> <br> $(document).ready(function(){ <br> function hbtn(btn) <br> { <br> $("#" btn).css("background-color", "green"); <br> } <br> function lbtn(btn) <br> { <br> $("#" btn).css("background-color" , "red"); <br> } <br> $("#s1").hover(function(){hbtn("s1");}, function(){lbtn("s1");}); <br> $("#s2").hover(function(){hbtn("s2");}, function(){lbtn("s2");}); <br> $("#s3") .hover(function(){hbtn("s3");}, function(){lbtn("s3");}); <br> $("#s4").hover(function(){hbtn(" s4");}, function(){lbtn("s4");}); <br> $("#s5").hover(function(){hbtn("s5");}, function(){ lbtn("s5");}); <br> }); <br> <br> </script>
A | B | | D | E |