The Input FileUpload object represents an HTML <input> element with type="file".
We can access an <input> element with type="file" via document.getElementById()
:
var x = document.getElementById("myFile");
Click the "Test" button to disable the file upload button.
<!DOCTYPE html> <html> <body> <input type="file" id="myFile"> <button onclick="myFunction()">Test</button> <script> function myFunction() {// w ww . jav a 2s .co m var x = document.getElementById("myFile"); x.disabled = true; } </script> </body> </html>