Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. HTMLAnchorElement
  4. password

HTMLAnchorElement: password property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

Thepassword property of theHTMLAnchorElement interface is a string containing the password component of the<a> element'shref. If the URL does not have a password, this property contains an empty string,"".

This property can be set to change the password of the URL. If the URL has nohost or its scheme isfile:, then setting this property has no effect.

The password ispercent-encoded when setting but not percent-decoded when reading.

SeeURL.password for more information.

Value

A string.

Examples

js
// An <a href="https://anonymous:flabada@developer.mozilla.org/en-US/docs/HTMLAnchorElement"> is in the documentconst anchor = document.getElementByID("myAnchor");anchor.password; // returns 'flabada'

Specifications

Specification
HTML
# dom-hyperlink-password-dev

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp