Get Input FileUpload Field - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input FileUpload


The Input FileUpload object represents an HTML <input> element with type="file".

You can access an <input> element with type="file" by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<input type="file" id="myFile">

<button onclick="myFunction()">disable the file upload button</button>

function myFunction() {//from   w  ww.  j a  v a  2  s  . c o  m
    var x = document.getElementById("myFile");
    x.disabled = true;


Related Tutorials