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);
}
βˆ‘ JS in Depth
XAH Β BUY NOW

JS in Depth

JS Obj Ref

DOM


DOM

Overview

Basic Examples

HTML Input

Web Scripting Examples

Web Scripting Misc

jQuery

node.js