HTMLAreaElement: ping property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The ping property of the HTMLAreaElement interface is a space-separated list of URLs. When the link is followed, the browser will send POST requests with the body PING to the URLs.

It reflects the ping attribute of the <area> element.

Note: This property is not effective in Firefox and its usage may be limited due to privacy and security concerns.

Example

html
<map name="example-map" id="example-map">
  <area
    href="https://example.com"
    ping="https://example-tracking.com https://example-analytics.com"
    alt="example" />
</map>
js
const areaCollection = document.getElementById("example-map").areas;
console.log(areaCollection[0].ping); // Output: "https://example-tracking.com https://example-analytics.com"

Specifications

Specification
HTML
# dom-area-ping

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
ping
Chrome – Full support
Chrome 12 (Release date: 2011-06-07)
footnote Full support
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Partial support
Firefox 1 (Release date: 2004-11-09)
footnote Partial support
footnote This property is exposed but has no effect if the browser.send_pings preference is not set to true. See bug 951104.
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 5.1 (Release date: 2011-07-20)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Partial support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Partial support
footnote This property is exposed but has no effect if the browser.send_pings preference is not set to true. See bug 951104.
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – Full support
Safari on iOS 5 (Release date: 2011-10-12)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 5 (Release date: 2011-10-12)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support

See also