Input FileUpload disabled Property - Find out if a FileUpload button is disabled - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input FileUpload

Description

Input FileUpload disabled Property - Find out if a FileUpload button is disabled

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

Get Image: <input type="file" id="myFile">
<br>

<button onclick="disableBtn()">Disable File Upload</button>
<button onclick="enableBtn()">Enable File Upload</button>

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

function enableBtn() {
    document.getElementById("myFile").disabled = false;
    var v = document.getElementById("myFile").disabled;
    console.log(v);
}
</script>

</body>
</html>

Related Tutorials