Full HTML of the upload form with image preview

Full HTML of the upload form with image preview

The upload form with image preview function, the complete HTML code is as follows
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Upload form with image preview function 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="Preview image" />
<br />
</div>
<div style="display:none">
</div>
</center>
</body>
</html>

<<:  How to encapsulate query components based on element-ui step by step

>>:  Introduction to /etc/my.cnf parameters in MySQL 5.7

Recommend

CSS multi-column layout solution

1. Fixed width + adaptive Expected effect: fixed ...

Detailed explanation of HTML table inline format

Inline format <colgroup>...</colgroup>...

Detailed explanation of MySQL user and permission management

This article uses examples to describe the manage...

How to start/stop Tomcat server in Java

1. Project Structure 2.CallTomcat.java package co...

Detailed explanation of how Zabbix monitors the master-slave status of MySQL

After setting up the MySQL master-slave, you ofte...

Ideas and codes for implementing waterfall flow layout in uniapp applet

1. Introduction Is it considered rehashing old st...

Commonly used English fonts for web page creation

Arial Arial is a sans-serif TrueType font distribu...

CSS World--Code Practice: Image Alt Information Presentation

Using the <img> element with the default sr...

Detailed explanation of JS ES6 variable destructuring assignment

Table of contents 1. What is deconstruction? 2. A...

Use of LRU algorithm in Vue built-in component keep-alive

Table of contents The use of Vue's keep-alive...

html opens a new window with a hyperlink and can control window properties

1. The window size opened by the HTML hyperlink C...

Detailed explanation of the role of static variables in MySQL

Detailed explanation of the role of static variab...

Windows 2016 Server Security Settings

Table of contents System update configuration Cha...