实时图片显示
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form action="./myta.php" method='post' target="" id='myfor' enctype="multipart/form-data">
<img src='' id='im'>
<input name='text' type='file' id='tt' value='1'>
<input type='submit'>
</form>
</body>
</html>
<script src='./jquery-1.12.4.js'></script>
<script>
$('#tt').change(function(){
var img=$(this)[0].files[0];
var url=window.URL.createObjectURL(img)
$('#im').attr('src',url);
// alert(url);
})
</script>