Window stop() Method - Disable a button - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window stop

Description

Window stop() Method - Disable a button

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p>Click to disable the BUTTON element:</p>

<button type="button" id="myBtn" onclick="myFunction()">Test</button>

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

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

</body>
</html>

Related Tutorials