您的位置:首页 > Web前端 > JavaScript

js实现复制功能(文件上传)

2012-11-07 20:58 711 查看
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> 支持IE浏览器以及IE8、不支持IE9 </title>
<meta charset="utf-8"/>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script>

function fuck(){
alert("1");
var  uploadHTML = document.createElement("<input type='file' name='upload'/>");
document.getElementById("files").appendChild(uploadHTML);
uploadHTML=document.createElement("<p/>");
document.getElementById("files").appendChild(uploadHTML);

}
</script>
</head>

<body>
<input type="button"  onclick="fuck();" value="create"/>
<br/>
<form onsubmit="return true;" method="post" enctype="multipart/form-data">
<span id="files"><input type='file' name='upload'/>
<p/>
</span>
<input type="submit" value="开始上传"/>
</form>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: