Latest web development tutorials

HTML DOM Password name attribute

Password Object Reference Password objects

Definition and Usage

name property sets or returns the name of the password field.

name attribute is used after the form is submitted to the server to transmit data or form data referenced in Javascript.

Note: After the form is submitted only name attribute of the form element will pass data values.

grammar

Setting name attribute:

passwordObject.name="name"

Returns the name attribute:

passwordObject.name


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support attribute name


Examples

Examples

The following example code domain names available:

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

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

</ Body>
</ Html>

try it"


Password Object Reference Password objects