HTML: Password Text Field

By Xah Lee. Date: . Last updated: .

Here's how to create a html password field input.

Result:

Masked text field is used for passwords. What user typed won't be shown.

<label for="passwordBox29732">password:</label>
<input id="passwordBox29732" type="password" size="30" maxlength="30" name="password">

<p>Result:
<span id="showBox13293"></span></p>
{
const passwordBox29732 = document. getElementById ('passwordBox29732');
const showBox13293 = document. getElementById ('showBox13293');

const f_update = (() => { showBox13293 .textContent = showBox13293.value; });

passwordBox29732.addEventListener ('input', f_update, false);
}

DOM How-To


Web Scripting Overview


HTML Input


Web Scripting Examples


Web Scripting Misc


jQuery


node.js

Like it? Help me by telling your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials