HTMLAnchorElement: username プロパティ
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年1月.
HTMLAnchorElement.username
プロパティは、ドメイン名の前で指定されたユーザー名の入った文字列です。
値
文字列です。
例
>アンカーリンクからユーザー名を取得
js
// <a id="myAnchor" href="https://anonymous:flabada@newreal1.mobosoft.fun/ja/docs/HTMLAnchorElement"> 要素が文書にあったとします
const anchor = document.getElementByID("myAnchor");
anchor.username; // 'anonymous' を返す
仕様書
Specification |
---|
HTML> # dom-hyperlink-username-dev> |
ブラウザーの互換性
Loading…
関連情報
- 所属先の
HTMLAnchorElement
インターフェイス