diff --git a/files/en-us/web/api/htmlanchorelement/index.md b/files/en-us/web/api/htmlanchorelement/index.md index 90fa8b9cd35c83c..a6b7ea2939c767d 100644 --- a/files/en-us/web/api/htmlanchorelement/index.md +++ b/files/en-us/web/api/htmlanchorelement/index.md @@ -33,6 +33,8 @@ _Inherits properties from its parent, {{domxref("HTMLElement")}}._ - : A string containing the password specified before the domain name. - {{domxref("HTMLAnchorElement.pathname")}} - : A string containing an initial `'/'` followed by the path of the URL, not including the query string or fragment. +- {{domxref("HTMLAnchorElement.ping")}} + - : A space-separated list of URLs. When the link is followed, the browser will send {{HTTPMethod("POST")}} requests with the body PING to the URLs. - {{domxref("HTMLAnchorElement.port")}} - : A string representing the port component, if any, of the referenced URL. - {{domxref("HTMLAnchorElement.protocol")}} diff --git a/files/en-us/web/api/htmlanchorelement/ping/index.md b/files/en-us/web/api/htmlanchorelement/ping/index.md new file mode 100644 index 000000000000000..0b36f4a6a247507 --- /dev/null +++ b/files/en-us/web/api/htmlanchorelement/ping/index.md @@ -0,0 +1,43 @@ +--- +title: "HTMLAnchorElement: ping property" +short-title: ping +slug: Web/API/HTMLAnchorElement/ping +page-type: web-api-instance-property +browser-compat: api.HTMLAnchorElement.ping +--- + +{{ApiRef("HTML DOM")}} + +The **`ping`** property of the {{domxref("HTMLAnchorElement")}} interface is a space-separated list of URLs. When the link is followed, the browser will send {{HTTPMethod("POST")}} requests with the body PING to the URLs. + +It reflects the `ping` attribute of the {{HTMLElement("a")}} element. + +> **Note:** This property is not effective in Firefox and its usage may be limited due to privacy and security concerns. + +## Example + +```html +Example Link +``` + +```js +const anchorElement = document.getElementById("exampleLink"); +console.log(anchorElement.ping); // Output: "https://example-tracking.com https://example-analytics.com" +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("HTMLAreaElement.ping")}} property