//删除附件 $(".removeFile").click(function(){ var input=$(this)[0].parentNode.childNodes[0]; input.parentNode.style.display="none"; var html=$(this).parent().html(); html=html.substring(0,html.indexOf(">")+1); $(html).replaceAll($(this).prev("input"));//解决删除附件时清空的问题 });