Input Password readOnly Property - Find out if a password field is read-only - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Password

Description

Input Password readOnly Property - Find out if a password field is read-only

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Password: <input type="password" id="myPsw">

<button onclick="myFunction()">Set read-only</button>

<script>
function myFunction() {/*from  www . j a va 2  s  .  com*/
    document.getElementById("myPsw").readOnly = true;
}
</script>

</body>
</html>

Related Tutorials