<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
< head runat ="server" >
< script type ="text/javascript" > ...
function changeimg(imgid,fileid)
...{
document.getElementById(imgid).src=document.getElementById(fileid).value;
}
</ script >
< title > 无标题页 </ title >
</ head >
< body >
< form id ="form1" runat ="server" >
< img src ="" style ="width: 117px; height: 63px" id ="image1" />
< input id ="File2" type ="file" runat ="server" onchange ="changeimg('image1','File2')" />
</ form >
</ body >
</ html >
< head runat ="server" >
< script type ="text/javascript" > ...
function changeimg(imgid,fileid)
...{
document.getElementById(imgid).src=document.getElementById(fileid).value;
}
</ script >
< title > 无标题页 </ title >
</ head >
< body >
< form id ="form1" runat ="server" >
< img src ="" style ="width: 117px; height: 63px" id ="image1" />
< input id ="File2" type ="file" runat ="server" onchange ="changeimg('image1','File2')" />
</ form >
</ body >
</ html >
效果如图: