diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index f34eb175c3bf518..621c9ae64f3107b 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -7948,6 +7948,18 @@ /en-US/docs/Web/API/HTMLFrameSetElement/onpopstate /en-US/docs/Web/API/WindowEventHandlers/onpopstate /en-US/docs/Web/API/HTMLFrameSetElement/onunload /en-US/docs/Web/API/WindowEventHandlers/onunload /en-US/docs/Web/API/HTMLHTMLElement.version /en-US/docs/Web/API/HTMLHtmlElement/version +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/hash /en-US/docs/Web/API/HTMLAnchorElement/hash +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/host /en-US/docs/Web/API/HTMLAnchorElement/host +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/hostname /en-US/docs/Web/API/HTMLAnchorElement/hostname +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/href /en-US/docs/Web/API/HTMLAnchorElement/href +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/origin /en-US/docs/Web/API/HTMLAnchorElement/origin +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/password /en-US/docs/Web/API/HTMLAnchorElement/password +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/pathname /en-US/docs/Web/API/HTMLAnchorElement/pathname +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/port /en-US/docs/Web/API/HTMLAnchorElement/port +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/protocol /en-US/docs/Web/API/HTMLAnchorElement/protocol +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search /en-US/docs/Web/API/HTMLAnchorElement/search +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/toString /en-US/docs/Web/API/HTMLAnchorElement/toString +/en-US/docs/Web/API/HTMLHyperlinkElementUtils/username /en-US/docs/Web/API/HTMLAnchorElement/username /en-US/docs/Web/API/HTMLIFrameElement.contentWindow /en-US/docs/Web/API/HTMLIFrameElement/contentWindow /en-US/docs/Web/API/HTMLIFrameElement/referrer /en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy /en-US/docs/Web/API/HTMLIFrameElement/setNfcFocus /en-US/docs/Web/API/HTMLIFrameElement diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index 602cada546daf91..37cd708fe1505da 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -55739,215 +55739,6 @@ "ThomasACorey" ] }, - "Web/API/HTMLHyperlinkElementUtils": { - "modified": "2020-11-13T08:35:00.542Z", - "contributors": [ - "Rumyra", - "chrisdavidmills", - "Wind1808", - "connorshea", - "fscholz", - "myf", - "RayannTedds", - "ricea", - "jpmedley", - "teoli", - "cvrebert", - "baku", - "Bzbarsky", - "Annevk" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/hash": { - "modified": "2020-10-15T21:24:52.659Z", - "contributors": [ - "Wind1808", - "sjfortin", - "Tigt", - "fscholz", - "SLYJason", - "lmika", - "jpmedley", - "libbymc", - "HassenPy", - "teoli", - "azasypkin", - "Sebastianz", - "chrisdavidmills", - "kohei.yoshino", - "vishu_gawli" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/host": { - "modified": "2020-10-15T21:24:52.503Z", - "contributors": [ - "Wind1808", - "fscholz", - "lap00zza", - "jpmedley", - "libbymc", - "teoli", - "Sebastianz", - "chrisdavidmills", - "cvrebert", - "mbudde", - "Bzbarsky", - "mattbasta", - "Kartik_Chadha" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/hostname": { - "modified": "2020-10-15T21:24:52.580Z", - "contributors": [ - "CarstenDeyl", - "Wind1808", - "fscholz", - "tyoshino", - "jpmedley", - "libbymc", - "teoli", - "chrisdavidmills", - "Kartik_Chadha" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/href": { - "modified": "2020-10-15T21:24:52.508Z", - "contributors": [ - "chrisdavidmills", - "Wind1808", - "alattalatta", - "fscholz", - "jpmedley", - "libbymc", - "nufercle", - "Sheppy", - "teoli", - "Sebastianz", - "kscarfone", - "Kartik_Chadha" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/origin": { - "modified": "2020-10-15T21:24:54.809Z", - "contributors": [ - "sideshowbarker", - "fscholz", - "jpmedley", - "libbymc", - "teoli", - "claudepache", - "chrisdavidmills", - "cvrebert", - "poke", - "jonathanKingston", - "ziyunfei", - "Korikulum", - "Kartik_Chadha" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/password": { - "modified": "2020-10-15T21:24:54.829Z", - "contributors": [ - "fscholz", - "sideshowbarker", - "jpmedley", - "Tigt", - "teoli", - "chrisdavidmills", - "Kartik_Chadha" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/pathname": { - "modified": "2020-11-13T08:38:15.177Z", - "contributors": [ - "Rumyra", - "Brettz9", - "fscholz", - "johnjacobkenny", - "erikadoyle", - "chrisdavidmills", - "jpmedley", - "libbymc", - "teoli", - "klusark", - "fusionchess", - "mturnwall", - "Kartik_Chadha", - "mikemcg" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/port": { - "modified": "2020-10-15T21:24:52.528Z", - "contributors": [ - "Wind1808", - "fscholz", - "adambrenecki", - "erikadoyle", - "jpmedley", - "libbymc", - "teoli", - "chrisdavidmills", - "Kartik_Chadha" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/protocol": { - "modified": "2020-10-15T21:24:52.609Z", - "contributors": [ - "Wind1808", - "epascarello", - "fscholz", - "erikadoyle", - "jpmedley", - "libbymc", - "teoli", - "chrisdavidmills", - "Kartik_Chadha" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/search": { - "modified": "2020-10-15T21:24:52.537Z", - "contributors": [ - "Wind1808", - "mfluehr", - "BuonOmo", - "fscholz", - "Jonathan_Watt", - "chrisdavidmills", - "jpmedley", - "AndySky21", - "libbymc", - "teoli", - "jsx", - "madarche", - "fusionchess", - "Kartik_Chadha" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/toString": { - "modified": "2020-10-15T21:24:54.612Z", - "contributors": [ - "sideshowbarker", - "fscholz", - "jpmedley", - "libbymc", - "nufercle", - "Sheppy", - "teoli", - "chrisdavidmills", - "Kartik_Chadha" - ] - }, - "Web/API/HTMLHyperlinkElementUtils/username": { - "modified": "2020-10-15T21:24:54.543Z", - "contributors": [ - "Wind1808", - "fscholz", - "jpmedley", - "teoli", - "chrisdavidmills", - "Kartik_Chadha" - ] - }, "Web/API/HTMLIFrameElement": { "modified": "2020-10-15T21:07:37.626Z", "contributors": [ @@ -165899,10 +165690,200 @@ "groovecoder" ] }, + "Web/API/HTMLAnchorElement/hash": { + "modified": "2020-10-15T21:24:52.659Z", + "contributors": [ + "Wind1808", + "sjfortin", + "Tigt", + "fscholz", + "SLYJason", + "lmika", + "jpmedley", + "libbymc", + "HassenPy", + "teoli", + "azasypkin", + "Sebastianz", + "chrisdavidmills", + "kohei.yoshino", + "vishu_gawli" + ] + }, + "Web/API/HTMLAnchorElement/href": { + "modified": "2020-10-15T21:24:52.508Z", + "contributors": [ + "chrisdavidmills", + "Wind1808", + "alattalatta", + "fscholz", + "jpmedley", + "libbymc", + "nufercle", + "Sheppy", + "teoli", + "Sebastianz", + "kscarfone", + "Kartik_Chadha" + ] + }, + "Web/API/HTMLAnchorElement/protocol": { + "modified": "2020-10-15T21:24:52.609Z", + "contributors": [ + "Wind1808", + "epascarello", + "fscholz", + "erikadoyle", + "jpmedley", + "libbymc", + "teoli", + "chrisdavidmills", + "Kartik_Chadha" + ] + }, + "Web/API/HTMLAnchorElement/host": { + "modified": "2020-10-15T21:24:52.503Z", + "contributors": [ + "Wind1808", + "fscholz", + "lap00zza", + "jpmedley", + "libbymc", + "teoli", + "Sebastianz", + "chrisdavidmills", + "cvrebert", + "mbudde", + "Bzbarsky", + "mattbasta", + "Kartik_Chadha" + ] + }, + "Web/API/HTMLAnchorElement/hostname": { + "modified": "2020-10-15T21:24:52.580Z", + "contributors": [ + "CarstenDeyl", + "Wind1808", + "fscholz", + "tyoshino", + "jpmedley", + "libbymc", + "teoli", + "chrisdavidmills", + "Kartik_Chadha" + ] + }, + "Web/API/HTMLAnchorElement/port": { + "modified": "2020-10-15T21:24:52.528Z", + "contributors": [ + "Wind1808", + "fscholz", + "adambrenecki", + "erikadoyle", + "jpmedley", + "libbymc", + "teoli", + "chrisdavidmills", + "Kartik_Chadha" + ] + }, + "Web/API/HTMLAnchorElement/pathname": { + "modified": "2020-11-13T08:38:15.177Z", + "contributors": [ + "Rumyra", + "Brettz9", + "fscholz", + "johnjacobkenny", + "erikadoyle", + "chrisdavidmills", + "jpmedley", + "libbymc", + "teoli", + "klusark", + "fusionchess", + "mturnwall", + "Kartik_Chadha", + "mikemcg" + ] + }, + "Web/API/HTMLAnchorElement/search": { + "modified": "2020-10-15T21:24:52.537Z", + "contributors": [ + "Wind1808", + "mfluehr", + "BuonOmo", + "fscholz", + "Jonathan_Watt", + "chrisdavidmills", + "jpmedley", + "AndySky21", + "libbymc", + "teoli", + "jsx", + "madarche", + "fusionchess", + "Kartik_Chadha" + ] + }, + "Web/API/HTMLAnchorElement/username": { + "modified": "2020-10-15T21:24:54.543Z", + "contributors": [ + "Wind1808", + "fscholz", + "jpmedley", + "teoli", + "chrisdavidmills", + "Kartik_Chadha" + ] + }, + "Web/API/HTMLAnchorElement/password": { + "modified": "2020-10-15T21:24:54.829Z", + "contributors": [ + "fscholz", + "sideshowbarker", + "jpmedley", + "Tigt", + "teoli", + "chrisdavidmills", + "Kartik_Chadha" + ] + }, + "Web/API/HTMLAnchorElement/origin": { + "modified": "2020-10-15T21:24:54.809Z", + "contributors": [ + "sideshowbarker", + "fscholz", + "jpmedley", + "libbymc", + "teoli", + "claudepache", + "chrisdavidmills", + "cvrebert", + "poke", + "jonathanKingston", + "ziyunfei", + "Korikulum", + "Kartik_Chadha" + ] + }, + "Web/API/HTMLAnchorElement/toString": { + "modified": "2020-10-15T21:24:54.612Z", + "contributors": [ + "sideshowbarker", + "fscholz", + "jpmedley", + "libbymc", + "nufercle", + "Sheppy", + "teoli", + "chrisdavidmills", + "Kartik_Chadha" + ] + }, "Web/API/Element/assignedSlot": { "modified": "2020-10-15T22:30:57.859Z", "contributors": [ "sideshowbarker" ] } -} \ No newline at end of file +} diff --git a/files/en-us/web/api/htmlanchorelement/hash/index.html b/files/en-us/web/api/htmlanchorelement/hash/index.html new file mode 100644 index 000000000000000..7eea813ab05ea99 --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/hash/index.html @@ -0,0 +1,68 @@ +--- +title: HTMLAnchorElement.hash +slug: Web/API/HTMLAnchorElement/hash +tags: + - API + - HTMLAnchorElement + - Property + - Reference +--- +
{{ APIRef("HTML DOM") }}
+ +

The + HTMLAnchorElement.hash property returns a + {{domxref("USVString")}} containing a '#' followed by the fragment + identifier of the URL.

+ +

The fragment is not percent-decoded. If the URL does not + have a fragment identifier, this property contains an empty string, "".

+ +

Syntax

+ +
+// Getter
+string = anchor.hash;
+// Setter
+anchor.hash = string;
+
+ +

Examples

+ +

Getting the hash from an anchor link

+ +Given this HTML + +
+<a id="myAnchor" href="/en-US/docs/HTMLAnchorElement#Examples">Examples</a>
+
+ +you can get the hash of the anchor like this: + +
+const anchor = document.getElementById("myAnchor");
+anchor.hash; // returns '#Examples'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-hash','HTMLHyperlinkElementUtils.hash')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAnchorElement.hash")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlanchorelement/host/index.html b/files/en-us/web/api/htmlanchorelement/host/index.html new file mode 100644 index 000000000000000..52597cb5fb4ea30 --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/host/index.html @@ -0,0 +1,62 @@ +--- +title: HTMLAnchorElement.host +slug: Web/API/HTMLAnchorElement/host +tags: + - API + - HTMLAnchorElement + - Property + - Reference +--- +
{{ApiRef("HTML DOM")}}
+ +

The HTMLAnchorElement.host property is a + {{domxref("USVString")}} containing the host, that is the hostname, and then, + if the port of the URL is nonempty, a ':', and the port + of the URL.

+ +

Syntax

+ +
+// Getter
+string = anchor.host;
+// Setter
+anchor.host = string;
+
+ +

Examples

+ +
const anchor = document.createElement("a");
+
+anchor.href = "https://developer.mozilla.org/en-US/HTMLAnchorElement"
+anchor.host == "developer.mozilla.org"
+
+anchor.href = "https://developer.mozilla.org:443/en-US/HTMLAnchorElement"
+anchor.host == "developer.mozilla.org"
+// The port number is not included because 443 is the scheme's default port
+
+anchor.href = "https://developer.mozilla.org:4097/en-US/HTMLAnchorElement"
+anchor.host == "developer.mozilla.org:4097"
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-host','HTMLHyperlinkElementUtils.host')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAnchorElement.host")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlanchorelement/hostname/index.html b/files/en-us/web/api/htmlanchorelement/hostname/index.html new file mode 100644 index 000000000000000..2f9367b06d76d3c --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/hostname/index.html @@ -0,0 +1,51 @@ +--- +title: HTMLAnchorElement.hostname +slug: Web/API/HTMLAnchorElement/hostname +tags: + - API + - HTMLAnchorElement + - Property + - Reference +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAnchorElement.hostname property is a + {{domxref("USVString")}} containing the domain of the URL.

+ +

Syntax

+ +
+// Getter
+string = anchor.hostname;
+// Setter
+anchor.hostname = string;
+
+ +

Examples

+ +
// An <a id="myAnchor" href="/en-US/docs/HTMLAnchorElement"> element is in the document
+const anchor = document.getElementById("myAnchor");
+anchor.hostname; // returns 'developer.mozilla.org'
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-hostname','HTMLHyperlinkElementUtils.hostname')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAnchorElement.hostname")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlanchorelement/href/index.html b/files/en-us/web/api/htmlanchorelement/href/index.html new file mode 100644 index 000000000000000..49ad23073681567 --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/href/index.html @@ -0,0 +1,54 @@ +--- +title: HTMLAnchorElement.href +slug: Web/API/HTMLAnchorElement/href +tags: + - API + - HTMLAnchorElement + - Location + - Property + - Reference +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAnchorElement.href property is a + stringifier that returns a {{domxref("USVString")}} containing the whole URL, and allows + the href to be updated.

+ +

Syntax

+ +
+// Getter
+string = anchor.href;
+// Setter
+anchor.href = string;
+
+ +

Examples

+ +
// An <a id="myAnchor" href="https://developer.mozilla.org/en-US/HTMLAnchorElement"> element is in the document
+const anchor = document.getElementById("myAnchor");
+anchor.href; // returns 'https://developer.mozilla.org/en-US/HTMLAnchorElement'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-href','HTMLHyperlinkElementUtils.href')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAnchorElement.href")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlanchorelement/index.html b/files/en-us/web/api/htmlanchorelement/index.html index 9e96f75ae35e917..90a812bce88113c 100644 --- a/files/en-us/web/api/htmlanchorelement/index.html +++ b/files/en-us/web/api/htmlanchorelement/index.html @@ -15,32 +15,32 @@

Properties

-

Inherits properties from its parent, {{domxref("HTMLElement")}}, and implements those from {{domxref("HTMLHyperlinkElementUtils")}}.

+

Inherits properties from its parent, {{domxref("HTMLElement")}}.

{{domxref("Element.accessKey")}}
Is a {{domxref("DOMString")}} representing a single character that switches input focus to the hyperlink.
{{domxref("HTMLAnchorElement.download")}} {{experimental_inline}}
Is a {{domxref("DOMString")}} indicating that the linked resource is intended to be downloaded rather than displayed in the browser. The value represent the proposed name of the file. If the name is not a valid filename of the underlying OS, browser will adapt it.
-
{{domxref("HTMLHyperlinkElementUtils.hash")}}
+
{{domxref("HTMLAnchorElement.hash")}}
Is a {{domxref("USVString")}} representing the fragment identifier, including the leading hash mark ('#'), if any, in the referenced URL.
-
{{domxref("HTMLHyperlinkElementUtils.host")}}
+
{{domxref("HTMLAnchorElement.host")}}
Is a {{domxref("USVString")}} representing the hostname and port (if it's not the default port) in the referenced URL.
-
{{domxref("HTMLHyperlinkElementUtils.hostname")}}
+
{{domxref("HTMLAnchorElement.hostname")}}
Is a {{domxref("USVString")}} representing the hostname in the referenced URL.
-
{{domxref("HTMLHyperlinkElementUtils.href")}}
+
{{domxref("HTMLAnchorElement.href")}}
Is a {{domxref("USVString")}} that is the result of parsing the {{htmlattrxref("href", "a")}} HTML attribute relative to the document, containing a valid URL of a linked resource.
{{domxref("HTMLAnchorElement.hreflang")}}
Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("hreflang", "a")}} HTML attribute, indicating the language of the linked resource.
-
{{domxref("HTMLHyperlinkElementUtils.password")}}
-
Is a {{domxref("USVString")}} containing the password specified before the domain name.
-
{{domxref("HTMLHyperlinkElementUtils.origin")}} {{readonlyInline}}
+
{{domxref("HTMLAnchorElement.origin")}} {{readonlyInline}}
Returns a {{domxref("USVString")}} containing the origin of the URL, that is its scheme, its domain and its port.
-
{{domxref("HTMLHyperlinkElementUtils.pathname")}}
+
{{domxref("HTMLAnchorElement.password")}}
+
Is a {{domxref("USVString")}} containing the password specified before the domain name.
+
{{domxref("HTMLAnchorElement.pathname")}}
Is a {{domxref("USVString")}} containing an initial '/' followed by the path of the URL, not including the query string or fragment.
-
{{domxref("HTMLHyperlinkElementUtils.port")}}
+
{{domxref("HTMLAnchorElement.port")}}
Is a {{domxref("USVString")}} representing the port component, if any, of the referenced URL.
-
{{domxref("HTMLHyperlinkElementUtils.protocol")}}
+
{{domxref("HTMLAnchorElement.protocol")}}
Is a {{domxref("USVString")}} representing the protocol component, including trailing colon (':'), of the referenced URL.
{{domxref("HTMLAnchorElement.referrerPolicy")}} {{experimental_inline}}
Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("referrerpolicy", "a")}} HTML attribute indicating which referrer to use.
@@ -48,7 +48,7 @@

Properties

Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("rel", "a")}} HTML attribute, specifying the relationship of the target object to the linked object.
{{domxref("HTMLAnchorElement.relList")}} {{readonlyInline}}
Returns a {{domxref("DOMTokenList")}} that reflects the {{htmlattrxref("rel", "a")}} HTML attribute, as a list of tokens.
-
{{domxref("HTMLHyperlinkElementUtils.search")}}
+
{{domxref("HTMLAnchorElement.search")}}
Is a {{domxref("USVString")}} representing the search element, including leading question mark ('?'), if any, of the referenced URL.
{{domxref("HTMLElement.tabindex")}}
Is a long containing the position of the element in the tabbing navigation order for the current document.
@@ -58,7 +58,7 @@

Properties

Is a {{domxref("DOMString")}} being a synonym for the {{domxref("Node.textContent")}} property.
{{domxref("HTMLAnchorElement.type")}}
Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("type", "a")}} HTML attribute, indicating the MIME type of the linked resource.
-
{{domxref("HTMLHyperlinkElementUtils.username")}}
+
{{domxref("HTMLAnchorElement.username")}}
Is a {{domxref("USVString")}} containing the username specified before the domain name.
@@ -81,15 +81,15 @@

Obsolete properties

Methods

-

Inherits methods from its parent, {{domxref("HTMLElement")}}, and implements those from {{domxref("HTMLHyperlinkElementUtils")}}.

+

Inherits methods from its parent, {{domxref("HTMLElement")}}.

{{domxref("HTMLElement.blur()")}}
Removes the keyboard focus from the current element.
{{domxref("HTMLElement.focus()")}}
Gives the keyboard focus to the current element.
-
{{domxref("HTMLHyperlinkElementUtils.toString()")}}
-
Returns a {{domxref("USVString")}} containing the whole URL. It is a synonym for {{domxref("HTMLHyperlinkElementUtils.href")}}, though it can't be used to modify the value.
+
{{domxref("HTMLAnchorElement.toString()")}}
+
Returns a {{domxref("USVString")}} containing the whole URL. It is a synonym for {{domxref("HTMLAnchorElement.href")}}, though it can't be used to modify the value.

The blur() and focus() methods are inherited from {{domxref("HTMLElement")}} from HTML5 on, but were defined on HTMLAnchorElement in DOM Level 2 HTML and earlier specifications.

@@ -100,31 +100,9 @@

Specifications

Specification - Status - Comment {{SpecName('HTML WHATWG', "#htmlanchorelement", "HTMLAnchorElement")}} - {{Spec2('HTML WHATWG')}} - The following property has been added: download.
- Technically, the URL-related properties, host, hostname, pathname, port, protocol, search, and hash, have been moved to the {{domxref("HTMLHyperlinkElementUtils")}} mixin, and HTMLAnchorElement implements this mixin. - - - {{SpecName('HTML5 W3C', "text-level-semantics.html#the-a-element", "HTMLAnchorElement")}} - {{Spec2('HTML5 W3C')}} - The methods blur() and focus(), as well as the properties tabindex and accessKey, are now defined on {{domxref("HTMLElement")}}.
- The following properties are now obsolete: charset, coords, name, rev, and shape.
- The following properties have been added: hash, host, hostname, pathname, port, protocol, relList, search, and text. - - - {{SpecName('DOM2 HTML', 'html.html#ID-48250443', 'HTMLAnchorElement')}} - {{Spec2('DOM2 HTML')}} - No change from {{SpecName("DOM1")}}. - - - {{SpecName('DOM1', 'level-one-html.html#ID-48250443', 'HTMLAnchorElement')}} - {{Spec2('DOM1')}} - Initial definition. @@ -134,7 +112,6 @@

Browser compatibility

{{Compat("api.HTMLAnchorElement")}}

See also

- diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/origin/index.html b/files/en-us/web/api/htmlanchorelement/origin/index.html similarity index 54% rename from files/en-us/web/api/htmlhyperlinkelementutils/origin/index.html rename to files/en-us/web/api/htmlanchorelement/origin/index.html index 6d3851a805f96fd..e0db760aec0a6dd 100644 --- a/files/en-us/web/api/htmlhyperlinkelementutils/origin/index.html +++ b/files/en-us/web/api/htmlanchorelement/origin/index.html @@ -1,19 +1,17 @@ --- -title: HTMLHyperlinkElementUtils.origin -slug: Web/API/HTMLHyperlinkElementUtils/origin +title: HTMLAnchorElement.origin +slug: Web/API/HTMLAnchorElement/origin tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Property -- Read-only -- Reference -- URL API + - API + - HTMLAnchorElement + - Property + - Read-only + - Reference --- -

{{APIRef("URL API")}}

+

{{APIRef("HTML DOM")}}

The - HTMLHyperlinkElementUtils.origin read-only property is a + HTMLAnchorElement.origin read-only property is a {{domxref("USVString")}} containing the Unicode serialization of the origin of the represented URL; that is:

@@ -28,17 +26,21 @@ "https://mozilla.org". -

{{AvailableInWorkers}}

-

Syntax

-
string = object.origin;
+
+// Getter
+string = anchor.origin;
+
+// No setter; read-only property
 

Examples

-
// On this page, returns the origin
-var result = window.location.origin; // Returns:'https://developer.mozilla.org'
+
+
// An <a id="myAnchor" href="https://developer.mozilla.org/en-US/HTMLAnchorElement"> element is in the document
+const anchor = document.getElementById("myAnchor");
+anchor.origin; // returns 'https://developer.mozilla.org'
 

Specifications

@@ -47,24 +49,19 @@

Specifications

Specification - Status - Comment - {{SpecName('HTML WHATWG', '#dom-hyperlink-origin', - 'HTMLHyperlinkElementUtils.origin')}} - {{Spec2('HTML WHATWG')}} - Initial definition. + {{SpecName('HTML WHATWG', '#dom-hyperlink-origin','HTMLHyperlinkElementUtils.origin')}}

Browser compatibility

-

{{Compat("api.HTMLHyperlinkElementUtils.origin")}}

+

{{Compat("api.HTMLAnchorElement.origin")}}

See also

diff --git a/files/en-us/web/api/htmlanchorelement/password/index.html b/files/en-us/web/api/htmlanchorelement/password/index.html new file mode 100644 index 000000000000000..f385c7d036ca8ee --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/password/index.html @@ -0,0 +1,55 @@ +--- +title: HTMLAnchorElement.password +slug: Web/API/HTMLAnchorElement/password +tags: + - API + - HTMLAnchorElement + - Property +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAnchorElement.password property is a + {{domxref("USVString")}} containing the password specified before the domain name.

+ +

If it is set without first setting the + username + property, it silently fails.

+ +

Syntax

+ +
+// Getter
+string = anchor.password;
+// Setter
+anchor.password = string;
+
+ +

Examples

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

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-password','HTMLHyperlinkElementUtils.password')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAnchorElement.password")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlanchorelement/pathname/index.html b/files/en-us/web/api/htmlanchorelement/pathname/index.html new file mode 100644 index 000000000000000..350bc822b91f25a --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/pathname/index.html @@ -0,0 +1,54 @@ +--- +title: HTMLAnchorElement.pathname +slug: Web/API/HTMLAnchorElement/pathname +tags: + - API + - HTMLAnchorElement + - Property + - Reference +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAnchorElement.pathname property is a + {{domxref("USVString")}} containing an initial '/' followed by the path of + the URL not including the query string or fragment (or the empty string if there is no + path).

+ +

Syntax

+ +
+// Getter
+string = anchor.pathname;
+// Setter
+anchor.pathname = string;
+
+ +

Examples

+ +
// An <a id="myAnchor" href="/en-US/docs/HTMLAnchorElement"> element is in the document
+const anchor = document.getElementById("myAnchor");
+anchor.pathname; // returns '/en-US/docs/HTMLAnchorElement'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-pathname','HTMLHyperlinkElementUtils.pathname')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAnchorElement.pathname")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlanchorelement/port/index.html b/files/en-us/web/api/htmlanchorelement/port/index.html new file mode 100644 index 000000000000000..5c6d5ac7c1d9a1f --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/port/index.html @@ -0,0 +1,55 @@ +--- +title: HTMLAnchorElement.port +slug: Web/API/HTMLAnchorElement/port +tags: + - API + - HTMLAnchorElement + - Property + - Reference +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAnchorElement.port property is a + {{domxref("USVString")}} containing the port number of the URL. If the URL does not + contain an explicit port number, it will be set to ''.

+ +

Syntax

+ +
+// Getter
+string = anchor.port;
+// Setter
+anchor.port = string;
+
+ +

Examples

+ +

Getting the port from an anchor link

+ +
// An <a id="myAnchor" href="https://developer.mozilla.org:443/en-US/docs/HTMLAnchorElement"> element is in the document
+const anchor = document.getElementByID("myAnchor");
+anchor.port; // returns '443'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-port','HTMLHyperlinkElementUtils.port')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAnchorElement.port")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlanchorelement/protocol/index.html b/files/en-us/web/api/htmlanchorelement/protocol/index.html new file mode 100644 index 000000000000000..5ae729ec6252543 --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/protocol/index.html @@ -0,0 +1,55 @@ +--- +title: HTMLAnchorElement.protocol +slug: Web/API/HTMLAnchorElement/protocol +tags: + - API + - HTMLAnchorElement + - Property +--- +

{{ApiRef("HTML DOM")}}

+ +

The + HTMLAnchorElement.protocol + property is a {{domxref("USVString")}} representing the protocol scheme of the URL, + including the final ':'.

+ +

Syntax

+ +
+// Getter
+string = anchor.protocol;
+// Setter
+anchor.protocol = string;
+
+ +

Examples

+ +

Getting the protocol of an anchor link

+ +
// An <a id="myAnchor" href="https://developer.mozilla.org/en-US/HTMLAnchorElement"> element is in the document
+const anchor = document.getElementById("myAnchor");
+anchor.protocol; // returns 'https:'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-protocol','HTMLHyperlinkElementUtils.protocol')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAnchorElement.protocol")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlanchorelement/search/index.html b/files/en-us/web/api/htmlanchorelement/search/index.html new file mode 100644 index 000000000000000..7e7720f4bad1c06 --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/search/index.html @@ -0,0 +1,68 @@ +--- +title: HTMLAnchorElement.search +slug: Web/API/HTMLAnchorElement/search +tags: + - API + - HTMLAnchorElement + - Property + - Reference +--- +
{{ApiRef("HTML DOM")}}
+ +

The HTMLAnchorElement.search property is a search + string, also called a query string, that is {{domxref("USVString")}} containing + a '?' followed by the parameters of the URL.

+ +

Modern browsers provide + URLSearchParams + and + URL.searchParams + to make it easy to parse out the parameters from the querystring.

+ +

Syntax

+ +
+// Getter
+string = anchor.search;
+// Setter
+anchor.search = string;
+
+ +

Examples

+ +

Getting the search string from an anchor link

+ +
// An <a id="myAnchor" href="/en-US/docs/HTMLAnchorElement?q=123"> element is in the document
+const anchor = document.getElementById("myAnchor");
+anchor.search; // returns '?q=123'
+
+ +

Advanced parsing using URLSearchParams

+Alternatively, URLSearchParams can be used:

+
+let params = new URLSearchParams(queryString);
+let q = parseInt(params.get("q"); // returns the number 123
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-search','HTMLHyperlinkElementUtils.search')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAnchorElement.search")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlanchorelement/tostring/index.html b/files/en-us/web/api/htmlanchorelement/tostring/index.html new file mode 100644 index 000000000000000..5f1303456d4d3fe --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/tostring/index.html @@ -0,0 +1,50 @@ +--- +title: HTMLAnchorElement.toString() +slug: Web/API/HTMLAnchorElement/toString +tags: + - API + - HTMLAnchorElement + - Method + - Stringifier +--- +

{{ApiRef("URL API")}}

+ +

The HTMLAnchorElement.toString() stringifier + method returns a {{domxref("USVString")}} containing the whole URL. It is a read-only + version of {{domxref("HTMLAnchorElement.href")}}.

+ +

Syntax

+ +
anchor.toString();
+ +

Examples

+ +

Calling toString on an anchor element

+ +
// An <a id="myAnchor" href="/en-US/docs/HTMLAnchorElement"> element is in the document
+const anchor = document.getElementById("myAnchor");
+anchor.toString(); // returns 'https://developer.mozilla.org/en-US/docs/HTMLAnchorElement'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', "#dom-hyperlink-href", 'HTMLHyperlinkElementUtils.href')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAnchorElement.toString")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlanchorelement/username/index.html b/files/en-us/web/api/htmlanchorelement/username/index.html new file mode 100644 index 000000000000000..628e247475d4d7d --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/username/index.html @@ -0,0 +1,54 @@ +--- +title: HTMLAnchorElement.username +slug: Web/API/HTMLAnchorElement/username +tags: + - API + - HTMLAnchorElement + - Property + - Reference +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAnchorElement.username property is a + {{domxref("USVString")}} containing the username specified before the domain name.

+ +

Syntax

+ +
+// Getter
+string = anchor.username;
+// Setter
+anchor.username = string;
+
+ +

Examples

+ +

Getting the username from an anchor link

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

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-username','HTMLHyperlinkElementUtils.username')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAnchorElement.username")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/hash/index.html b/files/en-us/web/api/htmlareaelement/hash/index.html new file mode 100644 index 000000000000000..97f564af67e7286 --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/hash/index.html @@ -0,0 +1,73 @@ +--- +title: HTMLAreaElement.hash +slug: Web/API/HTMLAreaElement/hash +tags: + - API + - HTMLAreaElement + - Property + - Reference +--- +
{{ APIRef("HTML DOM") }}
+ +

The + HTMLAreaElement.hash property returns a + {{domxref("USVString")}} containing a '#' followed by the fragment + identifier of the URL.

+ +

The fragment is not percent-decoded. If the URL does not + have a fragment identifier, this property contains an empty string, "".

+ +

Syntax

+ +
+// Getter
+string = area.hash;
+// Setter
+area.hash = string;
+
+ +

Examples

+ +

Getting the hash from an area link

+ +Given this HTML + +
+<map name="infographic">
+  <area id="mdn-circle" shape="circle" coords="130,136,60" 
+  href="https://developer.mozilla.org/#ExampleSection" alt="MDN" />
+</map>
+
+<img usemap="#infographic" src="/media/examples/mdn-info.png" alt="MDN infographic" />
+
+ +you can get the hash of the area link like this: + +
+const area = document.getElementById("mdn-circle");
+area.hash; // returns '#ExampleSection'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-hash','HTMLHyperlinkElementUtils.hash')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.hash")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/host/index.html b/files/en-us/web/api/htmlareaelement/host/index.html new file mode 100644 index 000000000000000..76ae6556ed77736 --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/host/index.html @@ -0,0 +1,62 @@ +--- +title: HTMLAreaElement.host +slug: Web/API/HTMLAreaElement/host +tags: + - API + - HTMLAreaElement + - Property + - Reference +--- +
{{ApiRef("HTML DOM")}}
+ +

The HTMLAreaElement.host property is a + {{domxref("USVString")}} containing the host, that is the hostname, and then, + if the port of the URL is nonempty, a ':', and the port + of the URL.

+ +

Syntax

+ +
+// Getter
+string = area.host;
+// Setter
+area.host = string;
+
+ +

Examples

+ +
const area = document.createElement("area");
+
+area.href = "https://developer.mozilla.org/en-US/HTMLAreaElement"
+area.host == "developer.mozilla.org"
+
+area.href = "https://developer.mozilla.org:443/en-US/HTMLAreaElement"
+area.host == "developer.mozilla.org"
+// The port number is not included because 443 is the scheme's default port
+
+area.href = "https://developer.mozilla.org:4097/en-US/HTMLAreaElement"
+area.host == "developer.mozilla.org:4097"
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-host','HTMLHyperlinkElementUtils.host')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.host")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/hostname/index.html b/files/en-us/web/api/htmlareaelement/hostname/index.html new file mode 100644 index 000000000000000..ee2273cc45d5f27 --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/hostname/index.html @@ -0,0 +1,51 @@ +--- +title: HTMLAreaElement.hostname +slug: Web/API/HTMLAreaElement/hostname +tags: + - API + - HTMLAreaElement + - Property + - Reference +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAreaElement.hostname property is a + {{domxref("USVString")}} containing the domain of the URL.

+ +

Syntax

+ +
+// Getter
+string = area.hostname;
+// Setter
+area.hostname = string;
+
+ +

Examples

+ +
// An <area id="myArea" href="/en-US/docs/HTMLAreaElement"> element is in the document
+const area = document.getElementById("myArea");
+HTMLAreaElement.hostname; // returns 'developer.mozilla.org'
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-hostname','HTMLHyperlinkElementUtils.hostname')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.hostname")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/href/index.html b/files/en-us/web/api/htmlareaelement/href/index.html new file mode 100644 index 000000000000000..2efff615a646171 --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/href/index.html @@ -0,0 +1,54 @@ +--- +title: HTMLAreaElement.href +slug: Web/API/HTMLAreaElement/href +tags: + - API + - HTMLAreaElement + - Location + - Property + - Reference +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAreaElement.href property is a + stringifier that returns a {{domxref("USVString")}} containing the whole URL, and allows + the href to be updated.

+ +

Syntax

+ +
+// Getter
+string = area.href;
+// Setter
+area.href = string;
+
+ +

Examples

+ +
// An <area id="myArea" href="https://developer.mozilla.org/en-US/HTMLAreaElement"> element is in the document
+const area = document.getElementById("myArea");
+area.href; // returns 'https://developer.mozilla.org/en-US/HTMLAreaElement'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-href','HTMLHyperlinkElementUtils.href')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.href")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/index.html b/files/en-us/web/api/htmlareaelement/index.html index 058743dc6790477..386f57b5bb7b8cc 100644 --- a/files/en-us/web/api/htmlareaelement/index.html +++ b/files/en-us/web/api/htmlareaelement/index.html @@ -15,7 +15,7 @@

Properties

-

Inherits properties from its parent, {{domxref("HTMLElement")}}, and implements those from {{domxref("HTMLHyperlinkElementUtils")}}.

+

Inherits properties from its parent, {{domxref("HTMLElement")}}.

{{domxref("Element.accessKey")}}
@@ -26,25 +26,25 @@

Properties

Is a {{domxref("DOMString")}} that reflects the {{ htmlattrxref("coords", "area") }} HTML attribute, containing coordinates to define the hot-spot region.
{{domxref("HTMLAreaElement.download")}} {{experimental_inline}}
Is a {{domxref("DOMString")}} indicating that the linked resource is intended to be downloaded rather than displayed in the browser. The value represent the proposed name of the file. If the name is not a valid filename of the underlying OS, browser will adapt it.
-
{{domxref("HTMLHyperlinkElementUtils.hash")}}
+
{{domxref("HTMLAreaElement.hash")}}
Is a {{domxref("USVString")}} containing the fragment identifier (including the leading hash mark (#)), if any, in the referenced URL.
-
{{domxref("HTMLHyperlinkElementUtils.host")}}
+
{{domxref("HTMLAreaElement.host")}}
Is a {{domxref("USVString")}} containing the hostname and port (if it's not the default port) in the referenced URL.
-
{{domxref("HTMLHyperlinkElementUtils.hostname")}}
+
{{domxref("HTMLAreaElement.hostname")}}
Is a {{domxref("USVString")}} containing the hostname in the referenced URL.
-
{{domxref("HTMLHyperlinkElementUtils.href")}}
+
{{domxref("HTMLAreaElement.href")}}
Is a {{domxref("USVString")}} containing that reflects the {{ htmlattrxref("href", "area") }} HTML attribute, containing a valid URL of a linked resource.
{{domxref("HTMLAreaElement.noHref")}} {{obsolete_inline}}
Is a {{jsxref("Boolean")}} flag indicating if the area is inactive (true) or active (false).
-
{{domxref("HTMLHyperlinkElementUtils.password")}}
-
Is a {{domxref("USVString")}} containing the password specified before the domain name.
-
{{domxref("HTMLHyperlinkElementUtils.origin")}} {{readonlyInline}}
+
{{domxref("HTMLAreaElement.origin")}} {{readonlyInline}}
Returns a {{domxref("USVString")}} containing the origin of the URL, that is its scheme, its domain and its port.
-
{{domxref("HTMLHyperlinkElementUtils.pathname")}}
+
{{domxref("HTMLAreaElement.password")}}
+
Is a {{domxref("USVString")}} containing the password specified before the domain name.
+
{{domxref("HTMLAreaElement.pathname")}}
Is a {{domxref("USVString")}} containing the path name component, if any, of the referenced URL.
-
{{domxref("HTMLHyperlinkElementUtils.port")}}
+
{{domxref("HTMLAreaElement.port")}}
Is a {{domxref("USVString")}} containing the port component, if any, of the referenced URL.
-
{{domxref("HTMLHyperlinkElementUtils.protocol")}}
+
{{domxref("HTMLAreaElement.protocol")}}
Is a {{domxref("USVString")}} containing the protocol component (including trailing colon ':'), of the referenced URL.
{{domxref("HTMLAreaElement.referrerPolicy")}} {{experimental_inline}}
Is a {{domxref("DOMString")}} that reflects the {{htmlattrxref("referrerpolicy", "area")}} HTML attribute indicating which referrer to use when fetching the linked resource.
@@ -52,7 +52,7 @@

Properties

Is a {{domxref("DOMString")}} that reflects the {{ htmlattrxref("rel", "area") }} HTML attribute, indicating relationships of the current document to the linked resource.
{{domxref("HTMLAreaElement.relList")}} {{readOnlyInline}}
Returns a {{domxref("DOMTokenList")}} that reflects the {{ htmlattrxref("rel", "area") }} HTML attribute, indicating relationships of the current document to the linked resource, as a list of tokens.
-
{{domxref("HTMLHyperlinkElementUtils.search")}}
+
{{domxref("HTMLAreaElement.search")}}
Is a {{domxref("USVString")}} containing the search element (including leading question mark '?'), if any, of the referenced URL.
{{domxref("HTMLAreaElement.shape")}}
Is a {{domxref("DOMString")}} that reflects the {{ htmlattrxref("shape", "area") }} HTML attribute, indicating the shape of the hot-spot, limited to known values.
@@ -60,17 +60,17 @@

Properties

Is a long containing the element's position in the tabbing order.
{{domxref("HTMLAreaElement.target")}}
Is a {{domxref("DOMString")}} that reflects the {{ htmlattrxref("target", "area") }} HTML attribute, indicating the browsing context in which to open the linked resource.
-
{{domxref("HTMLHyperlinkElementUtils.username")}}
+
{{domxref("HTMLAreaElement.username")}}
Is a {{domxref("USVString")}} containing the username specified before the domain name.

Methods

-

Inherits methods from its parent, {{domxref("HTMLElement")}}, and implements those from {{domxref("HTMLHyperlinkElementUtils")}}.

+

Inherits methods from its parent, {{domxref("HTMLElement")}}.

-
{{domxref("HTMLHyperlinkElementUtils.toString()")}}
-
Returns a {{domxref("USVString")}} containing the whole URL of the script executed in the {{domxref("Worker")}}. It is a synonym for {{domxref("HTMLHyperlinkElementUtils.href")}}.
+
{{domxref("HTMLAreaElement.toString()")}}
+
Returns a {{domxref("USVString")}} containing the whole URL of the script executed in the {{domxref("Worker")}}. It is a synonym for {{domxref("HTMLAreaElement.href")}}.

Specifications

@@ -79,31 +79,10 @@

Specifications

Specification - Status - Comment {{SpecName('HTML WHATWG', "#htmlareaelement", "HTMLAreaElement")}} - {{Spec2('HTML WHATWG')}} - The following property has been added: download.
- Technically, the URL-related properties, host, hostname, pathname, port, protocol, search, and hash, have been moving to the {{domxref("HTMLHyperlinkElementUtils")}} mixin, and HTMLAreaElement implements this mixin. - - - {{SpecName('HTML5 W3C', "embedded-content-0.html#the-area-element", "HTMLAreaElement")}} - {{Spec2('HTML5 W3C')}} - Technically, the properties tabindex and accesskey are now defined on {{domxref("HTMLElement")}}.
- The following property is now obsolete: nohref.
- The following properties have been added: rel, relList, hreflang, type, host, hostname, pathname, port, protocol, search, and hash. - - {{SpecName('DOM2 HTML', 'html.html#ID-26019118', 'HTMLAreaElement')}} - {{Spec2('DOM2 HTML')}} - No change from {{SpecName("DOM1")}}. - - - {{SpecName('DOM1', 'level-one-html.html#ID-26019118', 'HTMLAreaElement')}} - {{Spec2('DOM1')}} - Initial definition diff --git a/files/en-us/web/api/htmlareaelement/origin/index.html b/files/en-us/web/api/htmlareaelement/origin/index.html new file mode 100644 index 000000000000000..fe061788d280532 --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/origin/index.html @@ -0,0 +1,66 @@ +--- +title: HTMLAreaElement.origin +slug: Web/API/HTMLAreaElement/origin +tags: + - API + - HTMLAreaElement + - Property + - Read-only + - Reference +--- +

{{APIRef("HTML DOM")}}

+ +

The + HTMLAreaElement.origin read-only property is a + {{domxref("USVString")}} containing the Unicode serialization of the origin of the + represented URL; that is:

+ + + +

Syntax

+ +
+// Getter
+string = area.origin;
+
+// No setter; read-only property
+
+ +

Examples

+ +
// An <area id="myArea" href="https://developer.mozilla.org/en-US/HTMLAreaElement"> element is in the document
+const area = document.getElementById("myArea");
+area.origin; // returns 'https://developer.mozilla.org'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-origin','HTMLHyperlinkElementUtils.origin')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.origin")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/password/index.html b/files/en-us/web/api/htmlareaelement/password/index.html new file mode 100644 index 000000000000000..3d7967f84b75372 --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/password/index.html @@ -0,0 +1,55 @@ +--- +title: HTMLAreaElement.password +slug: Web/API/HTMLAreaElement/password +tags: + - API + - HTMLAreaElement + - Property +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAreaElement.password property is a + {{domxref("USVString")}} containing the password specified before the domain name.

+ +

If it is set without first setting the + username + property, it silently fails.

+ +

Syntax

+ +
+// Getter
+string = area.password;
+// Setter
+area.password = string;
+
+ +

Examples

+ +
// An <area id="myArea" href="https://anonymous:flabada@developer.mozilla.org/en-US/docs/HTMLAreaElement"> is in the document
+const area = document.getElementByID("myArea");
+area.password; // returns 'flabada'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-password','HTMLHyperlinkElementUtils.password')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.password")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/pathname/index.html b/files/en-us/web/api/htmlareaelement/pathname/index.html new file mode 100644 index 000000000000000..8cef0eaa4160613 --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/pathname/index.html @@ -0,0 +1,54 @@ +--- +title: HTMLAreaElement.pathname +slug: Web/API/HTMLAreaElement/pathname +tags: + - API + - HTMLAreaElement + - Property + - Reference +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAreaElement.pathname property is a + {{domxref("USVString")}} containing an initial '/' followed by the path of + the URL not including the query string or fragment (or the empty string if there is no + path).

+ +

Syntax

+ +
+// Getter
+string = area.pathname;
+// Setter
+area.pathname = string;
+
+ +

Examples

+ +
// An <area id="myArea" href="/en-US/docs/HTMLAreaElement"> element is in the document
+const area = document.getElementById("myArea");
+area.pathname; // returns '/en-US/docs/HTMLAreaElement'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-pathname','HTMLHyperlinkElementUtils.pathname')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.pathname")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/port/index.html b/files/en-us/web/api/htmlareaelement/port/index.html new file mode 100644 index 000000000000000..950a3c8a54b74cf --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/port/index.html @@ -0,0 +1,55 @@ +--- +title: HTMLAreaElement.port +slug: Web/API/HTMLAreaElement/port +tags: + - API + - HTMLAreaElement + - Property + - Reference +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAreaElement.port property is a + {{domxref("USVString")}} containing the port number of the URL. If the URL does not + contain an explicit port number, it will be set to ''.

+ +

Syntax

+ +
+// Getter
+string = area.port;
+// Setter
+area.port = string;
+
+ +

Examples

+ +

Getting the port from an area link

+ +
// An <area id="myArea" href="https://developer.mozilla.org:443/en-US/docs/HTMLAreaElement"> element is in the document
+const area = document.getElementByID("myArea");
+area.port; // returns '443'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-port','HTMLHyperlinkElementUtils.port')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.port")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/protocol/index.html b/files/en-us/web/api/htmlareaelement/protocol/index.html new file mode 100644 index 000000000000000..f87d4c52e1dd28d --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/protocol/index.html @@ -0,0 +1,55 @@ +--- +title: HTMLAreaElement.protocol +slug: Web/API/HTMLAreaElement/protocol +tags: + - API + - HTMLAreaElement + - Property +--- +

{{ApiRef("HTML DOM")}}

+ +

The + HTMLAreaElement.protocol + property is a {{domxref("USVString")}} representing the protocol scheme of the URL, + including the final ':'.

+ +

Syntax

+ +
+// Getter
+string = area.protocol;
+// Setter
+area.protocol = string;
+
+ +

Examples

+ +

Getting the protocol of an area link

+ +
// An <area id="myArea" href="https://developer.mozilla.org/en-US/HTMLAreaElement"> element is in the document
+const area = document.getElementById("myArea");
+area.protocol; // returns 'https:'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-protocol','HTMLHyperlinkElementUtils.protocol')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.protocol")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/search/index.html b/files/en-us/web/api/htmlareaelement/search/index.html new file mode 100644 index 000000000000000..d7b5e002a82a59e --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/search/index.html @@ -0,0 +1,68 @@ +--- +title: HTMLAreaElement.search +slug: Web/API/HTMLAreaElement/search +tags: + - API + - HTMLAreaElement + - Property + - Reference +--- +
{{ApiRef("HTML DOM")}}
+ +

The HTMLAreaElement.search property is a search + string, also called a query string, that is {{domxref("USVString")}} containing + a '?' followed by the parameters of the URL.

+ +

Modern browsers provide + URLSearchParams + and + URL.searchParams + to make it easy to parse out the parameters from the querystring.

+ +

Syntax

+ +
+// Getter
+string = area.search;
+// Setter
+area.search = string;
+
+ +

Examples

+ +

Getting the search string from an area link

+ +
// An <area id="myArea" href="/en-US/docs/HTMLAreaElement?q=123"> element is in the document
+const area = document.getElementById("myArea");
+area.search; // returns '?q=123'
+
+ +

Advanced parsing using URLSearchParams

+Alternatively, URLSearchParams can be used:

+
+let params = new URLSearchParams(queryString);
+let q = parseInt(params.get("q"); // returns the number 123
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-search','HTMLHyperlinkElementUtils.search')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.search")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/tostring/index.html b/files/en-us/web/api/htmlareaelement/tostring/index.html new file mode 100644 index 000000000000000..acd50cd7213d618 --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/tostring/index.html @@ -0,0 +1,50 @@ +--- +title: HTMLAreaElement.toString() +slug: Web/API/HTMLAreaElement/toString +tags: + - API + - HTMLAreaElement + - Method + - Stringifier +--- +

{{ApiRef("URL API")}}

+ +

The HTMLAreaElement.toString() stringifier + method returns a {{domxref("USVString")}} containing the whole URL. It is a read-only + version of {{domxref("HTMLAreaElement.href")}}.

+ +

Syntax

+ +
area.toString();
+ +

Examples

+ +

Calling toString on an area element

+ +
// An <area id="myArea" href="/en-US/docs/HTMLAreaElement"> element is in the document
+const area = document.getElementById("myArea");
+area.toString(); // returns 'https://developer.mozilla.org/en-US/docs/HTMLAreaElement'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', "#dom-hyperlink-href", 'HTMLHyperlinkElementUtils.href')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.toString")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlareaelement/username/index.html b/files/en-us/web/api/htmlareaelement/username/index.html new file mode 100644 index 000000000000000..dc885ecccd52c90 --- /dev/null +++ b/files/en-us/web/api/htmlareaelement/username/index.html @@ -0,0 +1,54 @@ +--- +title: HTMLAreaElement.username +slug: Web/API/HTMLAreaElement/username +tags: + - API + - HTMLAreaElement + - Property + - Reference +--- +

{{ApiRef("HTML DOM")}}

+ +

The HTMLAreaElement.username property is a + {{domxref("USVString")}} containing the username specified before the domain name.

+ +

Syntax

+ +
+// Getter
+string = area.username;
+// Setter
+area.username = string;
+
+ +

Examples

+ +

Getting the username from an area link

+ +
// An <area id="myArea" href="https://anonymous:flabada@developer.mozilla.org/en-US/docs/HTMLAreaElement"> element is in the document
+const area = document.getElementByID("myArea");
+area.username; // returns 'anonymous'
+
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('HTML WHATWG', '#dom-hyperlink-username','HTMLHyperlinkElementUtils.username')}}
+ +

Browser compatibility

+ +

{{Compat("api.HTMLAreaElement.username")}}

+ +

See also

+ + diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/hash/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/hash/index.html deleted file mode 100644 index f72bafb87a8832f..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/hash/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils.hash -slug: Web/API/HTMLHyperlinkElementUtils/hash -tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Property -- Reference -- URL API ---- -
{{ APIRef("URLUtils") }}
- -

The - HTMLHyperlinkElementUtils.hash property returns a - {{domxref("USVString")}} containing a '#' followed by the fragment - identifier of the URL.

- -

The fragment is not percent-decoded. If the URL does not - have a fragment identifier, this property contains an empty string, "".

- -

Syntax

- -
string = object.hash;
-object.hash = string;
-
- -

Examples

- -
<a id="myAnchor" href="/en-US/docs/HTMLHyperlinkElementUtils.href#Examples">Examples</a>
-<script>
-  var anchor = document.getElementById("myAnchor");
-  console.log(anchor.hash); // Returns '#Examples'
-</script>
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-hyperlink-hash', - 'HTMLHyperlinkElementUtils.hash')}}{{Spec2('HTML WHATWG')}}Initial definition
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils.hash")}}

- -

See also

- - diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/host/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/host/index.html deleted file mode 100644 index eb768b037416f12..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/host/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils.host -slug: Web/API/HTMLHyperlinkElementUtils/host -tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Property -- Reference -- URL API ---- -
{{ApiRef("URL API")}}
- -

The HTMLHyperlinkElementUtils.host property is a - {{domxref("USVString")}} containing the host, that is the hostname, and then, - if the port of the URL is nonempty, a ':', and the port - of the URL.

- -

Syntax

- -
string = object.host;
-object.host = string;
-
- -

Examples

- -
var anchor = document.createElement("a");
-
-anchor.href = "https://developer.mozilla.org/en-US/HTMLHyperlinkElementUtils.host"
-anchor.host == "developer.mozilla.org"
-
-anchor.href = "https://developer.mozilla.org:443/en-US/HTMLHyperlinkElementUtils.host"
-anchor.host == "developer.mozilla.org"
-// The port number is not included because 443 is the scheme's default port
-
-anchor.href = "https://developer.mozilla.org:4097/en-US/HTMLHyperlinkElementUtils.host"
-anchor.host == "developer.mozilla.org:4097"
-
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-hyperlink-host', - 'HTMLHyperlinkElementUtils.host')}}{{Spec2('HTML WHATWG')}}Initial definition
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils.host")}}

- -

See also

- - diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/hostname/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/hostname/index.html deleted file mode 100644 index 04d0a59710bf325..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/hostname/index.html +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils.hostname -slug: Web/API/HTMLHyperlinkElementUtils/hostname -tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Property -- Reference -- URL API ---- -

{{ApiRef("URL API")}}

- -

The HTMLHyperlinkElementUtils.hostname property is a - {{domxref("USVString")}} containing the domain of the URL.

- -

Syntax

- -
string = object.hostname;
-object.hostname = string;
-
- -

Examples

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

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-hyperlink-hostname', - 'HTMLHyperlinkElementUtils.hostname')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils.hostname")}}

- -

See also

- - diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/href/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/href/index.html deleted file mode 100644 index 24301bcdf88929b..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/href/index.html +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils.href -slug: Web/API/HTMLHyperlinkElementUtils/href -tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Location -- Property -- Reference -- URL API ---- -

{{ApiRef("URL API")}}

- -

The HTMLHyperlinkElementUtils.href property is a - stringifier that returns a {{domxref("USVString")}} containing the whole URL, and allows - the href to be updated.

- -

Syntax

- -
string = object.href;
-object.href = string;
-
- -

Examples

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

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-hyperlink-href', - 'HTMLHyperlinkElementUtils.href')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils.href")}}

- -

See also

- - diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/index.html deleted file mode 100644 index 18652de0d8ca3e2..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/index.html +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils -slug: Web/API/HTMLHyperlinkElementUtils -tags: - - API - - Experimental - - Mixin - - URL API ---- -

{{ApiRef("URL API")}}{{SeeCompatTable}}

- -

The HTMLHyperlinkElementUtils mixin defines utility methods and properties to work with {{domxref("HTMLAnchorElement")}} and {{domxref("HTMLAreaElement")}}. These utilities allow to deal with common features like URLs.

- -

There are no objects of this type, but several objects such as {{domxref("HTMLAnchorElement")}} and {{domxref("HTMLAreaElement")}} implement it.

- -

Properties

- -
-

Note: This interface doesn't inherit any property.

-
- -
-
{{domxref("HTMLHyperlinkElementUtils.href")}}
-
This a stringifier property that returns a {{domxref("USVString")}} containing the whole URL, and allows the href to be updated.
-
{{domxref("HTMLHyperlinkElementUtils.protocol")}}
-
This is a {{domxref("USVString")}} containing the protocol scheme of the URL, including the final ':'.
-
{{domxref("HTMLHyperlinkElementUtils.host")}}
-
This is a {{domxref("USVString")}} containing the host, that is the hostname, and then, if the port of the URL is not empty (which can happen because it was not specified or because it was specified to be the default port of the URL's scheme), a ':', and the port of the URL.
-
{{domxref("HTMLHyperlinkElementUtils.hostname")}}
-
This is a {{domxref("USVString")}} containing the domain of the URL.
-
{{domxref("HTMLHyperlinkElementUtils.port")}}
-
This is a {{domxref("USVString")}} containing the port number of the URL.
-
{{domxref("HTMLHyperlinkElementUtils.pathname")}}
-
Is a {{domxref("USVString")}} containing an initial '/' followed by the path of the URL, not including the query string or fragment.
-
{{domxref("HTMLHyperlinkElementUtils.search")}}
-
This is a {{domxref("USVString")}} containing a '?' followed by the parameters of the URL.
-
{{domxref("HTMLHyperlinkElementUtils.hash")}}
-
This is a {{domxref("USVString")}} containing a '#' followed by the fragment identifier of the URL.
-
{{domxref("HTMLHyperlinkElementUtils.username")}}
-
This is a {{domxref("USVString")}} containing the username specified before the domain name.
-
{{domxref("HTMLHyperlinkElementUtils.password")}}
-
This is a {{domxref("USVString")}} containing the password specified before the domain name.
-
{{domxref("HTMLHyperlinkElementUtils.origin")}} {{readonlyInline}}
-
This returns a {{domxref("USVString")}} containing the origin of the URL (that is its scheme, its domain and its port).
-
- -

Methods

- -
-

Note: This interface doesn't inherit any method.

-
- -
-
{{domxref("HTMLHyperlinkElementUtils.toString()")}}
-
This returns a {{domxref("USVString")}} containing the whole URL. It is a synonym for {{domxref("HTMLHyperlinkElementUtils.href")}}, though it can't be used to modify the value.
-
- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#htmlhyperlinkelementutils', 'HTMLHyperlinkElementUtils')}}{{Spec2('HTML WHATWG')}}Initial definition
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils")}}

- -

See also

- - diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/password/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/password/index.html deleted file mode 100644 index fe0083644c24d79..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/password/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils.password -slug: Web/API/HTMLHyperlinkElementUtils/password -tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Property -- Read-only -- URL API ---- -

{{ApiRef("URL API")}}

- -

The HTMLHyperlinkElementUtils.password property is a - {{domxref("USVString")}} containing the password specified before the domain name.

- -

If it is set without first setting the - username - property, it silently fails.

- -

Syntax

- -
string = object.password;
-object.password = string;
-
- -

Examples

- -
// Let's <a id="myAnchor" href="https://anonymous:flabada@developer.mozilla.org/en-US/docs/HTMLHyperlinkElementUtils.username"> be in the document
-var anchor = document.getElementByID("myAnchor");
-var result = anchor.password; // Returns:'flabada'
-
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-hyperlink-password', - 'HTMLHyperlinkElementUtils.password')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils.password")}}

- -

See also

- - diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/pathname/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/pathname/index.html deleted file mode 100644 index 346e2b4d6b6ba56..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/pathname/index.html +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils.pathname -slug: Web/API/HTMLHyperlinkElementUtils/pathname -tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Property -- Reference -- URL API ---- -

{{ApiRef("URL API")}}

- -

The HTMLHyperlinkElementUtils.pathname property is a - {{domxref("USVString")}} containing an initial '/' followed by the path of - the URL not including the query string or fragment (or the empty string if there is no - path).

- -

Syntax

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

Examples

- -
// Let's an <a id="myAnchor" href="/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

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-hyperlink-pathname', - 'HTMLHyperlinkElementUtils.pathname')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils.pathname")}}

- -

See also

- - diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/port/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/port/index.html deleted file mode 100644 index 39f036764300f34..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/port/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils.port -slug: Web/API/HTMLHyperlinkElementUtils/port -tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Property -- Reference -- URL API ---- -

{{ApiRef("URL API")}}

- -

The HTMLHyperlinkElementUtils.port property is a - {{domxref("USVString")}} containing the port number of the URL. If the URL does not - contain an explicit port number, it will be set to ''.

- -

Syntax

- -
string = object.port;
-object.port = string;
-
- -

Examples

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

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-hyperlink-port', - 'HTMLHyperlinkElementUtils.port')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils.port")}}

- -

See also

- - diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/protocol/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/protocol/index.html deleted file mode 100644 index 8c6aae024ca4e7b..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/protocol/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils.protocol -slug: Web/API/HTMLHyperlinkElementUtils/protocol -tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Property -- URL API ---- -

{{ApiRef("URL API")}}

- -

The - HTMLHyperlinkElementUtils.protocol - property is a {{domxref("USVString")}} representing the protocol scheme of the URL, - including the final ':'.

- -

Syntax

- -
string = object.protocol;
-object.protocol = string;
-
- -

Examples

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

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-hyperlink-protocol', - 'HTMLHyperlinkElementUtils.protocol')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils.protocol")}}

- -

See also

- - diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/search/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/search/index.html deleted file mode 100644 index 86e48db58632a9b..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/search/index.html +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils.search -slug: Web/API/HTMLHyperlinkElementUtils/search -tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Property -- Reference -- URL API ---- -
{{ApiRef("URL API")}}
- -

The HTMLHyperlinkElementUtils.search property is a search - string, also called a query string, that is {{domxref("USVString")}} containing - a '?' followed by the parameters of the URL.

- -

Modern browsers provide - URLSearchParams - and - URL.searchParams - to make it easy to parse out the parameters from the querystring.

- -

Syntax

- -
string = object.search;
-object.search = string;
-
- -

Examples

- -
// Let an <a id="myAnchor" href="/en-US/docs/HTMLHyperlinkElementUtils.search?q=123"> element be in the document
-var anchor = document.getElementById("myAnchor");
-var queryString = anchor.search; // Returns:'?q=123'
-
-// Further parsing:
-let params = new URLSearchParams(queryString);
-let q = parseInt(params.get("q"); // is the number 123
-
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-hyperlink-search', - 'HTMLHyperlinkElementUtils.search')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils.search")}}

- -

See also

- - diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/tostring/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/tostring/index.html deleted file mode 100644 index d18ddb5ec8ae74f..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/tostring/index.html +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils.toString() -slug: Web/API/HTMLHyperlinkElementUtils/toString -tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Location -- Method -- Stringifier -- URL API ---- -

{{ApiRef("URL API")}}

- -

The HTMLHyperlinkElementUtils.toString() stringifier - method returns a {{domxref("USVString")}} containing the whole URL. It is a read-only - version of {{domxref("HTMLHyperlinkElementUtils.href")}}.

- -

Syntax

- -
string = object.toString();
- -

Examples

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

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', "#dom-hyperlink-href")}}{{Spec2('HTML WHATWG')}}
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils.toString")}}

- -

See also

- - diff --git a/files/en-us/web/api/htmlhyperlinkelementutils/username/index.html b/files/en-us/web/api/htmlhyperlinkelementutils/username/index.html deleted file mode 100644 index b54c8195b07ea78..000000000000000 --- a/files/en-us/web/api/htmlhyperlinkelementutils/username/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils.username -slug: Web/API/HTMLHyperlinkElementUtils/username -tags: -- API -- Experimental -- HTMLHyperlinkElementUtils -- Property -- Reference -- URL API ---- -

{{ApiRef("URL API")}}

- -

The HTMLHyperlinkElementUtils.username property is a - {{domxref("USVString")}} containing the username specified before the domain name.

- -

Syntax

- -
string = object.username;
-object.username = string;
-
- -

Examples

- -
// Let's <a id="myAnchor" href="https://anonymous:flabada@developer.mozilla.org/en-US/docs/HTMLHyperlinkElementUtils.username"> be in the document
-var anchor = document.getElementByID("myAnchor");
-var result = anchor.username; // Returns:'anonymous'
-
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-hyperlink-username', - 'HTMLHyperlinkElementUtils.username')}}{{Spec2('HTML WHATWG')}}Initial definition.
- -

Browser compatibility

- -

{{Compat("api.HTMLHyperlinkElementUtils.username")}}

- -

See also

- -