function addFile() {
var fileDiv = document.all['fileDiv'];
var strHtml = '<span><input type="file"> <button οnclick="removeFile(parentNode);">删除</button><br></span>';
fileDiv.innerHTML += strHtml;
}
function removeFile(obj) {
obj.removeNode(true);
}
</script>
<form enctype="multipart/form-data">
<div id="fileDiv"></div>
<a href="javascript:void(addFile());" class="file">添加附件</a>
</form>
var fileDiv = document.all['fileDiv'];
var strHtml = '<span><input type="file"> <button οnclick="removeFile(parentNode);">删除</button><br></span>';
fileDiv.innerHTML += strHtml;
}
function removeFile(obj) {
obj.removeNode(true);
}
</script>
<form enctype="multipart/form-data">
<div id="fileDiv"></div>
<a href="javascript:void(addFile());" class="file">添加附件</a>
</form>