javascript - In jQuery, how do you select current table TR but not any nested table TR? -


so tried this:

input.find(" tr").each(function(){ ... }); 

i tried this:

input.find(" > tr").each(function(){ ... }); 

both of these not work. first 1 select tr if it's under nested table. second 1 not work if table have tbody or that. help?

input defined as:

var input = $(".myselectionscope"); 

the dom this:

    <div class='myselectionscope'>         <div> // optional             <table>                 <tbody>                     <tr>  // select 1                         <table>                             <tr>  // don't select 1                             .... 

with solution not matter whether have tbody tag in between:

$('table').find('tr:first').parent().children() 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -