Open In App

HTML <a> name Attribute

The HTML anchor name attribute is used to specify the name for an <a> element. It is used to reference the form data after submitting the form or to reference the element in JavaScript.

Note: The <a> name attribute is not supported by HTML5.



Syntax

<a name="name"> 

Attribute Values:

Attribute Value

Description

name

It describes the name of the <a> element.

Example: This example illustrates the use of an anchor name attribute in an HTML document.




<!DOCTYPE html>
<html>
 
<head>
    <title>HTML <a> name attribute</title>
</head>
 
<body>
    <h2>HTML <a> name Attribute</h2>
    <p>
        Welcome to
        <a href="https://www.geeksforgeeks.org/"
           name="Geeks">
          GeeksforGeeks
          </a>
    </p>
</body>
 
</html>

Output:



Related DOM Property:

Supported Browsers:

Article Tags :