Input Password size Property - Get the width of a password field: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Password

Description

Input Password size Property - Get the width of a password field:

Demo Code

ResultView the demo in separate window

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

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

<script>
function myFunction() {//  w  w w  .  j av  a2  s. c om
    var v = document.getElementById("myPsw").size;
    console.log(v);
}
</script>

</body>
</html>

Related Tutorials