Input Email disabled Property - Disable and enable an email field: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Email field

Description

Input Email disabled Property - Disable and enable an email field:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

E-mail: <input type="email" id="myEmail"><br><br>

<button onclick="disableBtn()">Disable Email Field</button>
<button onclick="enableBtn()">Enable Email Field</button>

<script>
function disableBtn() {/*from  ww  w  .  j  av  a2 s  .c o m*/
    document.getElementById("myEmail").disabled = true;
}

function enableBtn() {
    document.getElementById("myEmail").disabled = false;
}
</script>
</body>
</html>

Related Tutorials