Jquery list not the current one - Javascript jQuery

Javascript examples for jQuery:List

Description

Jquery list not the current one

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.3.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*from w  w w. java 2  s.  co m*/
$('li').click(function() {
    $(this).css('background-color', '#c7f1f2');
    $('li').not(this).css('background-color', '');
});
    });

      </script> 
 </head> 
 <body> 
  <ul> 
   <li>A</li> 
   <li>B</li> 
   <li>C</li> 
   <li>D</li> 
  </ul>  
 </body>
</html>

Related Tutorials