HTML <a> ping Attribute

Example

When the user clicks on the w3schools.com/html link, notify w3schools.com/trackpings:

<a href=”https://dwfaisalabad.com/” ping=”https://dwfaisalabad.com/trackpings”>

Definition and Usage

The ping attribute specifies a list of URLs to be notified if the user follows the hyperlink.

When the user clicks on the hyperlink, the ping attribute will send a short HTTP POST request to the specified URL.

This attribute is useful for monitoring/tracking.


Differences Between HTML 4.01 and HTML5

The ping attribute is new for the <a> tag in HTML5.


Syntax

<a ping=”URL”>

Attribute Values

Value Description
URL Specifies the URL to be notified if the user follows the hyperlink. Must be a space separated list of one or more valid URLs

Post Author: Zahid Farid