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
Post a Comment