Get Input FileUpload Field - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input FileUpload

Introduction

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>
<html>
<body>

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

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

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

</body>
</html>

Related Tutorials