-3
如何僅使用jQuery選擇器從以下代碼中選擇<th>
?謝謝!jQuery如何在表格中選擇內部編號
<table id='tab1'>
<tbody>
<tr>
<th>col1</th>
<th>col2</th>
</tr>
<tr>
...
</tr>
</table>
如何僅使用jQuery選擇器從以下代碼中選擇<th>
?謝謝!jQuery如何在表格中選擇內部編號
<table id='tab1'>
<tbody>
<tr>
<th>col1</th>
<th>col2</th>
</tr>
<tr>
...
</tr>
</table>
使用以下:
$("#tab1 th")
var th = $('#tab1 th');
或
var th = $('th', '#tab1');
你嘗試過什麼?你有沒有讀過基本的jQuery教程,因爲這是基本的,你可以得到。 –