当前位置:首页 > 开发教程 > html教程 >

带有图片预览功能的上传表单的完整HTML

时间:2014-06-09 23:14 来源: 作者: 收藏

带有图片预览功能的上传表单,完整的HTML代码如下所示html head meta http-equiv=Content-Type content=text/html; charset=gb2312 title带有图片预览功能的上传表单webjx.com/title script&g 点评:带有图片预览功能的上传表单,完整的HTML代码如下所示 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>带有图片预览功能的上传表单webjx.com</title> <script&g
带有图片预览功能的上传表单,完整的HTML代码如下所示
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>带有图片预览功能的上传表单jb51.net</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" onchange="viewmypic(showimg,this.form.imgfile);" />
<br />
</form>
<img name="showimg" id="showimg" src="" style="display:none;" alt="预览图片" />
<br />
</div>
<div style="display:none">
</div>
</center>
</body>
</html>

html教程阅读排行

最新文章