JQuery finding the item id - Javascript jQuery

Javascript examples for jQuery:Tag Traversing

Description

JQuery finding the item id

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.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//  w ww  .  ja  va 2  s  .c om
$(document).ready(function(){
    $t = $("li")[0];
    $($t).after("<p>placing.....</p>");
});
    });

      </script> 
 </head> 
 <body> 
  <div class="container"> 
   <h2>Greetings</h2> 
   <li id="one">Div #1</li> 
   <li id="two">Div #2</li> 
  </div>  
 </body>
</html>

Related Tutorials