全てにおいて良い日、
これは本当に問題ではありません。しかし、特定の要素の値を見つける別の方法があるかどうかを知りたいだけです。だから私はここにサンプルを持っています。
<table class="test">
<thead>..</thead>
<tfoot>..</tfoot>
<tbody>
<tr>
<td class="foo>1<td>
<td class="foo>7<td>
<td class="foo>1<td>
</tr>
</tbody>
</table>
<table class="test">
<thead>..</thead>
<tfoot>..</tfoot>
<tbody>
<tr>
<td class="foo>1<td>
<td class="foo>3<td>
<td class="foo>2<td>
</tr>
</tbody>
</table>
<table class="test">
<thead>..</thead>
<tfoot>..</tfoot>
<tbody>
<tr>
<td class="foo>5<td>
<td class="foo>1<td>
<td class="foo>3<td>
</tr>
</tbody>
</table>
私の解決策:
$("table.test").each(function() {
alert($(this).find("td.foo:first").text());
});
<td class="foo">
したがって、これは各テーブルの最初のすべてに警告します。
これを行う別の方法があるのだろうか。
ありがとう