HTMLHyperlinkElementUtils.pathname

HTMLHyperlinkElementUtils.pathname 属性是一个 USVString ,其中包含一个初始的'/'后跟URL的路径。

Syntax

string = object.pathname;
object.pathname = string;

Examples

// Let's an <a id="myAnchor" href="https://developer.mozilla.org/en-US/docs/HTMLHyperlinkElementUtils.pathname"> element be in the document
var anchor = document.getElementById("myAnchor");
var result = anchor.pathname; // Returns:'/en-US/docs/HTMLHyperlinkElementUtils.pathname'

Specifications

Specification Status Comment
HTML Living Standard
HTMLHyperlinkElementUtils.pathname
Living Standard Initial definition.

Browser compatibility

BCD tables only load in the browser

See also