就象以前的163邮箱,里面有添加附件按钮,按一下就多出一个文件上传框,怎么实现呢?
------解决方案--------------------
<script>
function add(){
var f = document.getElementById( "form1 ");
var newObj = document.createElement( "INPUT ");
newObj.type= "file ";
newObj.name= "myfile ";
f.appendChild(newObj);
newObj = document.createElement( "BR ");
f.appendChild(newObj);
}
</script>
<body>
<form id= "form1 ">
<input type= "button " onclick= "add() " value= "Add "> <br/>
</form>
</body>