我有一个这样的表:
<table>
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<tr>
<td class= checkinput >
<input type="checkbox" name="names" value="MD5_HASH"/>
</td>
<td>
John Doe
</td>
<td>
email@mail.com
</td>
</tr>
<!-- etc. -->
</tbody>
</table>
Essentially, I m trying to build an application where you can select each row in the table that you want, then export the emails to a comma-delimited list. The problem I m having is how to traverse the table and grab the information I need.
目前,为了方便起见,我已做以下工作,以便每行在点击时把检查箱捆绑起来。 不幸的是,当查箱直接点击时,没有发生任何事情,因为它试图在叫作Java文本时盘点自己,将其送回:
$("tr").click(function() {
var $checkbox = $(this).find(":checkbox");
$checkbox.attr( checked , !$checkbox.attr( checked ));
});
我如何能够优化这一努力,使它能够点击投入本身,而不是发生这场冲突?
而且,当我最后准备提交时,我如何从选择<代码><input>的每行转和阅读电子邮件?