Jquery selecting third child - Javascript jQuery Selector

Javascript examples for jQuery Selector:nth-child

Description

Jquery selecting third child

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.10.1.js"></script> 
  <script type="text/javascript">
    $(function(){//from   w ww  .  j av  a  2s. com
$(".blue:eq(3)").css('color','red');
    });

      </script> 
 </head> 
 <body> 
  <div class="blue">
    a 
  </div> 
  <div class="blue">
    b 
  </div> 
  <div class="blue">
    c 
  </div> 
  <div class="blue">
    d 
  </div>  
 </body>
</html>

Related Tutorials