HTML a Tag ping Attribute Tutorial

In this section, we will learn about the ping attribute that belongs to HTML <a> element.

What is ping Attribute in HTML <a> Tag?

The ping attribute is mainly used for tracking! Basically, this attribute takes one or more URLs as its value, and when a user clicks on the link, the browser will send a short POST request to the list of URLs declared as the value of the ping attribute.

HTML ping Attribute in <a> Tag Syntax:

<a ping= "url1 url2 urln">

<a> Tag ping Attribute Values

The value of the ping attribute is one or more URLs, each separated with an empty space.

After a user clicks on the link, a short POST request will be sent to each of the specified URLs in the ping attribute.

Example: using ping attribute in HTML <a> tag

See the Pen Untitled by Omid Dehghan (@odchan1) on CodePen.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies