Easy Tutorial
❮ Prop Audio Seeking Jsref Fill ❯

Password form Attribute


Definition and Usage

The form attribute returns a reference to the form that contains the password field.

This attribute returns a form object.

Syntax


Browser Support

All major browsers support the form attribute.


Example

The following example retrieves the ID of the form to which the password field belongs:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
<script>
function displayResult(){
    var x=document.getElementById("pwd").form.id;
    alert(x);
}
</script>
</head>
<body>

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

</body>
</html>

❮ Prop Audio Seeking Jsref Fill ❯