我有一个动态创建的记录列表,如下所示:
Option 1 <a href="#modal" data-id="1">delete</a>
Option 2 <a href="#modal" data-id="2">delete</a>
Option 3 <a href="#modal" data-id="3">delete</a>
Option 4 <a href="#modal" data-id="4">delete</a>
和 Remodal 窗口(更多信息的来源在这里https://github.com/VodkaBears/Remodal#remodal):
<div class="remodal-bg">
<div class="remodal" data-remodal-id="modal">
<button data-remodal-action="close" class="remodal-close"></button>
<h1>Deleting record</h1>
<p>
Are sou sure?
</p>
<br>
<button data-remodal-action="cancel" class="remodal-cancel">Cancel</button>
<button data-remodal-action="confirm" class="remodal-confirm">OK</button>
</div>
如果我按下删除,一切正常,模态窗口打开但是......我怎么知道我点击了 ID 3 或...... ID 2 的记录......所以我可以将它发送到我的 jQuery ajax 并删除它如果最后我在模态窗口中按下确定按钮,在我的数据库中?谢谢!