我有我目前使用的显示隐藏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