x
 
<!DOCTYPE html>
<html>
<body>
<h1>演示如何访问文件上传按钮</h1>
<input type="file" id="myFile">
<p>单击“试一试”按钮禁用文件上传按钮。</p>
<button onclick="myFunction()">试一试</button>
<script>
function myFunction() {
  var x = document.getElementById("myFile");
  x.disabled = true;
}
</script>
</body>
</html>