<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<input type="file" name="upFile" onChange="document.getElementsByTagName('img')[0].src=this.value">
<img width="400" height="300">
</body>
</html>是这个意思吗?
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<input type="file" name="upFile" onChange="document.getElementsByTagName('img')[0].src=this.value">
<img width="400" height="300">
</body>
</html>是这个意思吗?
<img src='链接地址'>
对,但是怎么让IMG显示出我选择的图片呢?
我说的是用JS做,不是给img固定图片
说了 就把地址赋给img就行了
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>文档 </title>
</head> <body>
<input type="file" name="upFile" onChange="document.getElementsByTagName('img')[0].src=this.value">
<img width="400" height="300">
</body>
</html>没理由 你就选择你本地盘符下的图片试下阿
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>文档 </title>
<script>
function chkimg(value){
document.getElementsByTagName('img')[0].src="file:///"+value
}
</script>
</head> <body>
<input type="file" name="upFile" onChange="chkimg(this.value)">
<img width="400" height="300" id="xsimg" src="F:\yb.jpg">
</body>
</html>
DHTML
<div id="pic" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);width:300px;height:250px; overflow:auto">
</div>js
document.getElementById("pic").filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = url
搞了有一周,不过效果很酷.