HTMLAnchorElement: password プロパティ

Baseline Widely available

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

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
Please take two minutes to fill out our short survey.

HTMLAnchorElement.password プロパティは、ドメイン名の前で指定されたパスワードが入った文字列です。

先に username プロパティを設定せずに設定しようとすると、暗黙のうちに失敗します。

文字列です。

js
// <a id="myAnchor" href="https://anonymous:flabada@developer.mozilla.org/ja/HTMLAnchorElement"> 要素が文書にあったとします
const anchor = document.getElementByID("myAnchor");
anchor.password; // 'flabada' を返す

仕様書

Specification
HTML
# dom-hyperlink-password-dev

ブラウザーの互換性

関連情報