帶有圖片預覽功能的上傳表單的完整HTML
<html><head>
<meta http-equiv="Content-Type" c>
<title>帶有圖片預覽功能的上傳表單</title>
<script>
function viewmypic(mypic,imgfile) {
if (imgfile.value){
mypic.src=imgfile.value;
mypic.style.display="";
mypic.border=1;
}
}
</script>
</head>
<body>
<center>
<form >
<input name="imgfile" type="file" id="imgfile" size="40"/>
</form>
<img name="showimg" id="showimg" src="" style="display:none;" alt="預覽圖片" />
</div>
<div style="display:none">
</div>
</center>
</body>
</html>
頁:
[1]