我有我目前使用的顯示隱藏div.a_type如何使用jQuery添加DOM元素?
我怎麼能修改此代碼,以便代替隱藏的div褪色, 我可以添加新的div到DOM
一個功能可按jQuery(function(){ // Add Answer jQuery(".add_answer").click(function(){ if(count >= "4"){ alert('Only 4 Answers Allowed'); }else{ var count = $(this).attr("alt"); count++; $(this).parents('div:first').find('.a_type_'+count+'').fadeIn(); $(this).attr("alt", count); } }); });
好了,現在我有這個整理出來,我有一個問題,
我還有一個功能,如果點擊一個按鈕,刪除插入div的。 現在不工作,額外的div沒有加載到頁面加載到DOM。 我如何觸發功能來刪除這些?
jQuery的(函數(){//隱藏答案
jQuery(".destroy_answer").click(function(){
$(this).parents("div:first").fadeOut(function(){ $(this).remove() });
var count = $(this).parents('div:first').parents('div:first').find('.add_answer').attr("alt");
count--;
$(this).parents('div:first').parents('div:first').find('.add_answer').attr("alt", count);
});
});
快速筆記,而你可以打印HTML無法通過JavaScript打印PHP自PHP是一種預處理。 – 2008-12-27 22:37:17
相關知識...您如何建議我在我的打印中打印php會話數據? – adam 2008-12-27 22:40:31