

js 获取
代码如下:
function show(){
var p=document.getElementById("file1").value;
document.getElementById("s").innerHTML=" ";
document.getElementById("pic").src=p;
alert(p);
}
script>
清空上传控件()的值的两种方法
方法1:
代码如下:
function show()
{
document.getElementById("span1").innerHTML="";
}
script>
方法2:
代码如下:
function clearFileInput(file){
var form=document.createElement('form');
document.body.appendChild(form);
//记住file在旧表单中的的位置
var pos=file.nextSibling;
form.appendChild(file);
form.reset();
pos.parentNode.insertBefore(file,pos);
document.body.removeChild(form);
}
