Javascript examples for jQuery Selector:eq
Get child element by index in Jquery
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.js"></script> <script type="text/javascript"> $(window).load(function(){/*from w ww. ja va 2 s . co m*/ console.log($('div.second div:eq(0)').attr('id')); }); </script> </head> <body> <div class="second"> <div class="selector" id="selFirst"></div> <div class="selector" id="selSecond"></div> <div></div> </div> </body> </html>