Latest web development tutorials

HTML DOM Password type property

Password Object Reference Password objects

Definition and Usage

type property returns the type of form elements.

For the password field, this property is always "password".

grammar

passwordObject.type


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support attribute type


Examples

Examples

The following example returns the form element type of the password field:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function displayResult () {
var x = document.getElementById ( "pwd") type.;
alert (x);
}
</ Script>
</ Head>
<Body>

<Form>
Password: <input type = "password" id = "pwd">
</ Form>
<Button type = "button" onclick = "displayResult ()"> Display input type </ button>

</ Body>
</ Html>

try it"


Password Object Reference Password objects