$("#my").click(function() {
$(this.title).remove();
});
我已經使用jQuery動態地添加和刪除html內容,但是如何刪除哪些創建動態添加。如何刪除使用jQuery動態創建的類
$("#my").click(function() {
$(this.title).remove();
});
我已經使用jQuery動態地添加和刪除html內容,但是如何刪除哪些創建動態添加。如何刪除使用jQuery動態創建的類
事件代表團使用了動態添加元素
試試這個
$(document).on("click","#my",function(){
$(this).removeClass(this.title);
//or
$(this.title).remove();
});
我想
$('#my').click(function(){
$(this).removeClass(this.title);
$(this).addClass(this.title);
$(this).toggleClass(this.title);
})
你正在尋找一個這些?
請澄清「但是如何刪除動態添加的哪個創建。」,你需要從$(「#my」)中刪除一個類嗎? – 2013-04-24 05:36:10