Complete HTML of upload form with picture preview function

Time:2022-7-29

Upload form with picture preview function, complete HTMLcodeAs shown below
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>
<title> upload form with picture 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 picture” / >
<br />
</div>
<div style=”display:none”>
</div>
</center>
</body>
</html>

Recommended Today

JS generate guid method

JS generate guid method https://blog.csdn.net/Alive_tree/article/details/87942348 Globally unique identification(GUID) is an algorithm generatedBinaryCount Reg128 bitsNumber ofidentifier , GUID is mainly used in networks or systems with multiple nodes and computers. Ideally, any computational geometry computer cluster will not generate two identical guids, and the total number of guids is2^128In theory, it is difficult to make two […]