繼續明天就點擊這個「X」符號,我想刪除列表質疑jquery刪除行上點擊不工作?
function n() {
$('.m').on('click',function() {
var id = $(this).closest("tr").find(".t").text();
var p= $(this).closest("tr").find(".t1").text();
$('#c').append('<li class='li'>',id,<span class='c'>'"X"'</span>','</li>');
});
}
<style>
.c:hover
{
color:red;
}
.li
{
}
<script type="text/javascript">
$(document).on('click','.c',function()
{
$(this).closest("li").remove()
alert("ok");
});
</script>
,在警報「確定」打印,但刪除功能不能正常工作,爲什麼?
有很多語法錯誤的代碼。請至少提供運行代碼。我不知道你的代碼中是否真的存在這些錯誤,或者你只是在這裏潦草地複製你的代碼。 –
風格標籤沒有關閉 –