Retrieve only one table row from a list with filter() - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:filter

Description

Retrieve only one table row from a list with filter()

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.7.1.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/*w  w w .j a v a2  s .  c o m*/
var rows = '<tr id="0"></tr><tr id="1"></tr><tr id="2"></tr><tr id="3"></tr><tr id="4"></tr>';
console.log($(rows).filter("#2"));
    });

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials