Input Reset disabled Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Reset

Description

The disabled property sets or gets whether a reset button should be disabled.

This property reflects the HTML disabled attribute.

Set the disabled property with the following Values

Value Description
true|false Sets whether a reset button should be disabled

Return Value

A Boolean, returns true if the reset button is disabled, otherwise it returns false

The following code shows how to disable a Reset button:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="reset" id="myReset">

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {//w  w  w . j  a v a  2 s  . co m
    document.getElementById("myReset").disabled = true;
}
</script>

</body>
</html>

Related Tutorials