zoukankan      html  css  js  c++  java
  • 带有图片预览功能的上传表单 上传预览

    效果如下:



    <html>       
    <head>       
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">       
    <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" 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> 
  • 相关阅读:
    【leetcode】Validate Binary Search Tree
    【leetcode】Add Binary
    【leetcode】Search a 2D Matrix
    绑定方法与非绑定方法||反射||内置方法
    封装||property
    组合||抽象类||多态||鸭子类型
    在子类中重用父类的属性
    继承||派生||继承实现原理
    面向对象小练习
    面向对象编程
  • 原文地址:https://www.cnblogs.com/dupeng0811/p/1415366.html
Copyright © 2011-2022 走看看