input上传图片预览

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>uploadPreview演示</title>
    <script src="uploadPreview.js" type="text/javascript"></script>
    <script>
       window.onload = function () { 
            new uploadPreview({ UpBtn: "up_img", DivShow: "imgdiv", ImgShow: "imgShow" });
        }
    </script>
</head>
<body>
    <div id="imgdiv"><img id="imgShow" width="100" height="100" /></div>
    <input type="file" id="up_img" />
</body>
</html>
View Code

 

posted @ 2016-08-08 16:27  dongxiaolei  阅读(111)  评论(0编辑  收藏  举报