function appendA(){
var fileType_ = $("[name='file']").val();
var childrenlength = $('#hiddenfile').children().length;
$("#hiddenfile").append("<div style=\"padding:5px;padding-left:10px\"><a id='file1a"+childrenlength+"' href=\"#\">"+fileType_+"</a>"+
"<input id='file1"+childrenlength+"' type=hidden name='file1' value='"+fileType_+"'/>"+
"<a style=\"margin-left:20px;\" οnclick=\"deleteFile('#file1a"+childrenlength+"')\" href=\"#\" >删除</a>"+
"</br></div>");
$("#file1a"+childrenlength).html($("#file").val());
$("#file").replaceWith("<input type=\"file\" id=\"file\" name=\"file\">");
}
向div中动态添加删除节点
最新推荐文章于 2023-06-10 18:39:47 发布