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

Detailed explanation of TypeScript's basic types

Table of contents Boolean Type Number Types Strin...

Solve the problem of MySQL using not in to include null values

Notice! ! ! select * from user where uid not in (...

6 ways to view the port numbers occupied by Linux processes

For Linux system administrators, it is crucial to...

Use of select, distinct, and limit in MySQL

Table of contents 1. Introduction 2. select 2.1 Q...

How to allow remote connection in MySql

How to allow remote connection in MySql To achiev...

Example of Html shielding right-click menu and left-click typing function

Disable right-click menu <body oncontextmenu=s...

Introduction to the usage of common XHTML tags

There are many tags in XHTML, but only a few are ...

Detailed process of installing the docker plugin in IntelliJ IDEA (2018 version)

Table of contents 1. Development Environment 2. I...

Rainbow button style made with CSS3

Result: Implementation code: html <div class=&...

CSS3 realizes the mask barrage function

Recently I saw a barrage effect on B station call...

The difference and use of json.stringify() and json.parse()

1. Differences between JSON.stringify() and JSON....

MySQL index usage monitoring skills (worth collecting!)

Overview In a relational database, an index is a ...

Classes in TypeScript

Table of contents 1. Overview 2. Define a simple ...