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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -