Open In App

HTML <a> name Attribute

Last Updated : 12 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

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.

html




<!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:

  • Google Chrome 1
  • Edge 12
  • Firefox 1
  • Opera 15
  • Apple Safari 1

Similar Reads

HTML | &lt;button&gt; name Attribute
The &lt;button&gt; name attribute is used to specify the name attribute of &lt;button&gt; element. It is used to reference the form-data after submitting the form or to reference the element in a JavaScript. Syntax: &lt;button name="name"&gt; Attribute Values: It contains a single value name which describes the name of the &lt;button&gt; element. E
1 min read
HTML | &lt;form&gt; name Attribute
The HTML &lt;form&gt; name Attribute is used to specify the name of a form Element. It is used to reference the form-data after submitting the form or to reference the element in a JavaScript. Syntax: &lt;form name="name"&gt; Attribute Values: It contains a single value name which describes the name of the &lt;form&gt; element. Example: C/C++ Code
1 min read
HTML | &lt;input&gt; name Attribute
The HTML &lt;input&gt; name Attribute is used to specify a name for an &lt;input&gt; element. It is used to reference the form-data after submitting the form or to reference the element in a JavaScript. Syntax: &lt;input name="name"&gt; Attribute Values: It contains a single value name which describes the name of the &lt;input&gt; element. Example:
1 min read
HTML | &lt;textarea&gt; name Attribute
The HTML &lt;textarea&gt; name Attribute is used to specify a name of the &lt;Textarea&gt; Element. It is used to reference the form-data after submitting the form or to reference the element in a JavaScript. Syntax: &lt;Textarea name="text"&gt; Attribute Values: It contains the value i.e name which specify the name for the &lt;Textarea&gt; element
1 min read
HTML | &lt;select&gt; name Attribute
The HTML &lt;select&gt; name Attribute is used to specify a name for the drop-down list. It is used to reference the form-data after submitting the form or to reference the element in a JavaScript. Syntax: &lt;select name="text"&gt; Attribute Values: It contains the value i.e name which specify the name for the &lt;select&gt; element. Example: C/C+
1 min read
HTML | param name Attribute
The HTML param name Attribute is used to specify a name of a &lt;param&gt; element. This attribute is used together with the value attribute to define a parameter for plug-ins which is associated with &lt;object&gt; element. Syntax: &lt;param name="name"&gt; Note: This attribute is depreciated from HTML 5. Attribute Values: It contains the value i.
1 min read
HTML | &lt;object&gt; name Attribute
The HTML &lt;object&gt; name Attribute is used to specify the name of the embedded file. This attribute is also used as a reference for an object element in the Javascript. Syntax: &lt;object name="name"&gt; Attribute Values: name: It specify the name of the embedded file. Example: C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html&amp;gt; &amp;
1 min read
HTML | &lt;map&gt; name Attribute
The HTML &lt;map&gt; name Attribute is used to specify the name of the mapping image, This attribute is associated with the &lt;img&gt; usemap attribute and created the relationship between the image and the map. Syntax: &lt;map name="mapname"&gt; Attribute Values: name: it specify the name of the image map. Example: C/C++ Code &amp;lt;!DOCTYPE htm
1 min read
HTML | &lt;iframe&gt; name Attribute
The HTML iframe name Attribute is used to specify a reference for an &lt;Iframe&gt; Element. The name attribute is also used as a reference to the elements in a Javascript. Syntax: &lt;iframe name="name"&gt; Attribute Values: name: It specify the name for the Iframe element. Example: C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html&amp;gt;
1 min read
HTML | &lt;meta&gt; name Attribute
The HTML &lt;meta&gt; name Attribute is used to specify the name for the metadata. This attribute is used to define the name for the information/value of the content attribute. Note: If the http-equiv attribute is set, the name attribute should not be set. Syntax: &lt;meta name="value"&gt; Examples: C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;
1 min read