Input Radio disabled Property - Disable and enable a radio button: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Radio

Description

Input Radio disabled Property - Disable and enable a radio button:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

Radio Button: <input type="radio" id="myRadio">

<button onclick="disable()">Disable radio button</button>
<button onclick="enable()">Enable radio button</button>

<script>
function disable() {//from   w w  w  .  j  a  v  a 2  s .  c  o m
    document.getElementById("myRadio").disabled = true;
}

function enable() {
    document.getElementById("myRadio").disabled = false;
}
</script>

</body>
</html>

Related Tutorials