pingLimited availability
The ping attribute for <a> elements sets a URL to send a POST request to when the <a> is clicked. This is typically used for outbound link reporting.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1–11Not supported
12+Supportedsince Jun 7, 2011
Current: 155Edge
12–16Not supported
17+Supportedsince Apr 30, 2018
Current: 154Firefox
✕Not supportedup to 157
Current: 157Safari
1–5.1Not supported
6+Supportedsince Jul 25, 2012
Current: 27MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155Firefox Android
✕Not supportedup to 157
Current: 157Safari iOS
1–5Not supported
6+Supportedsince Sep 10, 2012
Current: 27How to use
Not supported in Firefox, Firefox Android. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: ping.
Feature detection
JS · check before using
if ("HTMLAnchorElement" in globalThis && "ping" in HTMLAnchorElement.prototype) {
// HTMLAnchorElement.ping is available
}Specification
Usage share
Sub-features
Support for each part of the feature (6). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| HTMLAnchorElement.ping | 12 | 17 | ✕ | 5.1 | 18 | ✕ | 5 |
| HTMLAreaElement.ping | 12 | 17 | ✕ | 5.1 | 18 | ✕ | 5 |
| SVGAElement.ping | 144 | 144 | ✕ | ✕ | 144 | ✕ | ✕ |
| a.ping | 12 | 17 | ✕ | 6 | 18 | ✕ | 6 |
| area.ping | 12 | 17 | ✕ | 6 | 18 | ✕ | 6 |
| a.ping | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |