--- title: HTMLHyperlinkElementUtils.pathname slug: Web/API/HTMLAnchorElement/pathname tags: - API - Experimental - HTMLHyperlinkElementUtils - Property - Reference - URL API translation_of: Web/API/HTMLHyperlinkElementUtils/pathname original_slug: Web/API/HTMLHyperlinkElementUtils/pathname ---
{{ApiRef("URL API")}}
HTMLHyperlinkElementUtils.pathname プロパティは、最初の '/' とその後に続く URL のパス(または、パスがない場合は空の文字列)を含む {{domxref("USVString")}} です。
string = object.pathname; object.pathname = string;
// <a id="myAnchor" href="https://developer.mozilla.org/en-US/docs/HTMLHyperlinkElementUtils.pathname"> 要素がドキュメントにあるとします
var anchor = document.getElementById("myAnchor");
var result = anchor.pathname; // 戻り値: '/en-US/docs/HTMLHyperlinkElementUtils.pathname'
| 仕様 | 状態 | コメント |
|---|---|---|
| {{SpecName('HTML WHATWG', '#dom-hyperlink-pathname', 'HTMLHyperlinkElementUtils.pathname')}} | {{Spec2('HTML WHATWG')}} | 初期定義 |
{{Compat("api.HTMLHyperlinkElementUtils.pathname")}}