Availability
JavaScript 1.0; enhanced in JavaScript 1.1
Inherits from/Overrides
Inherits from Input, HTMLElement
Synopsis
form.nameform.elements[i]
Properties
Password inherits properties from Input and HTMLElement and defines
or overrides the following:
value
A read/write string that specifies the password entered by the user.
It is the value sent over the Net when the form is submitted. The
initial value of this property is specified by the
value attribute of the
<input> element that defined the Password
object. Note that because of the sensitive nature of password input,
security restrictions may protect the value
property. In some browsers, the string returned when querying this
property may not match the text entered by the user, and setting the
property may have no effect on either the displayed value or the
value submitted upon form submission.
Methods
Password inherits methods from Input and HTMLElement.
Event Handlers
Password inherits event handlers from Input and HTMLElement.
HTML Syntax
A Password element is created with a
standard HTML <input> tag:
<form>
...
<input
type="password" // Specifies that this is a Password element
[ name="name" ] // A name you can use later to refer to this element
// Specifies the name property
[ value="default" ] // The default value transmitted when the form is submitted
[ size="integer" ] // How many characters wide the element is
>
...
</form>
Description
The Password element is a text input field intended for input of
sensitive data, such as passwords. As the user types characters, only
asterisks appear. This prevents bystanders from reading the input
value over the user's shoulder. As a further security
precaution, there are limitations on how JavaScript can read and
write the value property of a Password element.
See the Text and Input reference pages
for more information.
See Also
Input, Text; HTMLInputElement in the DOM reference section
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.