JS 清空input file的值,兼容所有主流浏览器



<html>

<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
var $file;
$(document).ready(function(){
  $(":file").live("change",function(){

  this.outerHTML += ''; 
  this.value ="";

  });
});
</script>
</head>

<body>
<input type="file" id="file"/>
</body>

</html> 


你可能感兴趣的:(function,浏览器,File,input)