How can I change background color in selected item in list with javascript?
Here is code I got:
HTML Code:
  1. <html>
  2. <title>Testing</title>
  3. <style type="text/css">
  4. body {
  5. background-color:black;
  6. }
  7. #navigation ul{ width: 150px; }
  8. #navigation ul li {
  9.   list-style: none;
  10.   background-color: transparent;
  11.   border-top: none;
  12.   text-align: left;
  13.   margin: 0;
  14.  }
  15. #navigation ul li a {
  16.   display: block;
  17.   text-decoration: none;
  18.   color:white;
  19.   padding: .25em;
  20.   border-bottom: none;
  21.   border-right: none;
  22.  }
  23.  #navigation ul li:hover {
  24.  background-color:lightblue;
  25.  }
  26. </style>
  27. <head>
  28. <script type="text/javascript">
  29.  
  30. </script>
  31. </head>
  32. <body>
  33. <div id ="navigation">
  34. <ul>
  35. <li><a href="#">Home</a></li>
  36. <li><a href="#">FAQ</a></li>
  37. <li><a href="#">Gallery</a></li>
  38. <li><a href="#">About Us</a></li>
  39. </ul>
  40. </div>
  41. </body>
  42. </html>