だから私はこれを試しました:
input.find(" tr").each(function(){ ... });
私もこれを試しました:
input.find(" > tr").each(function(){ ... });
これらはどちらも機能しません。最初のものは、ネストされたテーブルの下にある場合でも、TR を選択します。テーブルに tbody などがある場合、2 つ目は機能しません。何か助けはありますか?
入力は次のように定義されます。
var input = $(".mySelectionScope");
DOM は次のようになります。
<div class='mySelectionScope'>
<div> // Optional
<table>
<tbody>
<tr> // Select this one
<table>
<tr> // Don't select this one
....