1
我有兩列...右列我想打開並顯示內容,當它的標題被點擊,或者它的相應值在左側列被點擊...並關閉時,另一個值被點擊。謝謝您的幫助。列點擊問題
<table>
<tr>
<th>1</th>
<td>
<div class="showMeOnClick">stuff</div>
</td>
</tr>
<tr>
<th>2</th>
<td>
<div class="showMeOnClick">different stuff</div>
</td>
</tr>
<tr>
<th>3</th>
<td>
<div id="showMeOnClick">stuff</div>
</td>
</tr>
</table>
$('th').each(function() {
$(this).click(function() {
$(this).find('td').toggle();
});
});