Javascript DOM HTML Input FileUpload disabled Property get

Introduction

Find out if a FileUpload button is disabled or not:

var x = document.getElementById("myFile").disabled;

Click the button below to find out if the File Upload button above is disabled.

View in separate window

<!DOCTYPE html>
<html>
<body>

Get file: <input type="file" id="myFile" disabled>
<button onclick="myFunction()">Test</button>

<p id="demo"></p>

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

</body>
</html>



PreviousNext

Related