以下是我的代碼
$(document).ready(function() {
$(document).on('click', '.delete', function (event) {
event.preventDefault();
var id = $(this).closest('.row').attr('id'); // row ID
alert(id);
var i = confirm("Want to Delete this");
if (i === true) {
$("#" + id).remove();
}
});
});
此代碼不能在點擊任何元素排它被移除內容,並沒有問Want to delete this
代碼正常工作應只有激活點擊.delete
這是我的小提琴http://jsfiddle.net/RHKhw/
如何糾正它。
確認彈出窗口「彈出」在你的小提琴(鉻)完美。 –
@ChristoferEliasson會有什麼不同? – Scimonster
小提琴彈出問題,當我點擊圖片 –