How can I change background color in selected item in list with javascript?
Here is code I got:
HTML Code:
<html> <title>Testing</title> <style type="text/css"> body { background-color:black; } #navigation ul{ width: 150px; } #navigation ul li { list-style: none; background-color: transparent; border-top: none; text-align: left; margin: 0; } #navigation ul li a { display: block; text-decoration: none; color:white; padding: .25em; border-bottom: none; border-right: none; } #navigation ul li:hover { background-color:lightblue; } </style> <head> <script type="text/javascript"> </script> </head> <body> <div id ="navigation"> <ul> <li><a href="#">Home</a></li> <li><a href="#">FAQ</a></li> <li><a href="#">Gallery</a></li> <li><a href="#">About Us</a></li> </ul> </div> </body> </html>




Reply With Quote