我在一排桌子上有两个按钮(
<tr>
)中。每当单击某个按钮时,我都有以下事件处理程序来阻止行接收单击。
$(".btn").on('click', function(e){
e.stopPropagation();
})
这也阻止了模态打开。
我有以下按钮:
<tr>
<td>
<a><button data-toggle="modal" data-target= "#emailModal" data-player="<%=JSON.stringify(player)%>" data-player_id="<%=doc.id%>" data-result="pass" data-recipient="<%=player.email%>" class="btn btn-outline-danger action-btn reject-btn">Reject</button></a>
<a><button data-toggle="modal" data-target= "#emailModal" data-player="<%=JSON.stringify(player)%>" data-player_id="<%=doc.id%>" data-result="Approve" data-recipient="<%=player.email%>" class="btn btn-outline-success action-btn approve-btn">Approve</button></a>
</td>
</tr>
如何确保事件传播到模式,以便它被启动/显示,但不传播到外部div(
<tr>
)是吗?
编辑
以下内容:
<% players.forEach(doc => { %>
<tr class="trow" onclick="document.location = '/leaderboard/<%=doc.id%>';">