在 jquery 中制作表格行而不是表格标题 [英] Making table rows but not table headers clickable in jquery
问题描述
目前我正在使用
$('#mytable tr').click(function() {
blah blah
});
这使得所有行,包括标题都可以点击.如何排除标题或 This makes all rows, including the headers clickable. How can I exclude the headers or 使用 Separate you header and body using HTML 看起来像这样 HTML will look something like this 这篇关于在 jquery 中制作表格行而不是表格标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! 的标题?
<th>
's?推荐答案
和
标签将标题和正文分开,并更改你的选择器
"#mytable tbody tr"
<thead>
and <tbody>
tags, and change your selector to "#mytable tbody tr"
<table>
<thead>
<tr>
...
</tr>
</thead>
<tbody>
<tr>
...
</tr>
</tbody>
</table>
登录
关闭