带有图片预览功能的上传表单的完整HTML
点击次数:21 次 发布日期:2008-11-21 11:26:53 作者:源代码网
|
源代码网推荐源代码网整理以下带有图片预览功能的上传表单,完整的HTML代码如下所示
源代码网整理以下
以下为引用的内容:
源代码网整理以下<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>带有图片预览功能的上传表单webjx.com</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>
|
源代码网供稿. |