让input file只读。。代码如下:
<input type="file" name="file" id="file" style="width:270px;" UNSELECTABLE ="on" />
关键在于 UNSELECTABLE ="on"
将input file里面的文本值清空,代码如下:
var sender=document.thevalueform.file; var nf = sender.cloneNode(true); nf.value=''; // 设置新控件value为空 sender.parentNode.replaceChild(nf, sender);