【发布时间】:2015-07-24 23:38:54
【问题描述】:
我在表格中绑定了数据并在模态引导程序中显示它们。 我想使用单击或双击获取行表的数据,但它不起作用
<div class="modal-body">
<table id="table_search" class="table table-hover">
<thead>
<tr>
<td>CCA</td>
<td>Name</td>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
我使用jquery如下
$('#table_search > tbody > tr').click(function () {
alert( $(this).val());
});
$('#table_search > tbody > tr').dblclick(function () {
alert($(this).val());
});
但它不起作用。
【问题讨论】:
-
你是在modal触发之前还是之后绑定click事件?
-
好的,三个答案很好。谢谢各位。
标签: javascript jquery twitter-bootstrap modal-dialog html-table