<html>
<head>
<script language="javascript">
function showPic(FilePathValue,strShowImgDivID,strW,strH)
{
var Pic = document.getElementById(strShowImgDivID);
Pic.innerHTML="<img src='"+FilePathValue+"' width='"+strW+"' height='"+strH+"' border='0'>";
}
</script>
</head>
<body>
<input type="file" onChange="showPic(this.value,'div1',200,200);">
<div id="div1"></div>
</body>
</html>
<head>
<script language="javascript">
function showPic(FilePathValue,strShowImgDivID,strW,strH)
{
var Pic = document.getElementById(strShowImgDivID);
Pic.innerHTML="<img src='"+FilePathValue+"' width='"+strW+"' height='"+strH+"' border='0'>";
}
</script>
</head>
<body>
<input type="file" onChange="showPic(this.value,'div1',200,200);">
<div id="div1"></div>
</body>
</html>
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/649/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
评论列表