HTML a name Attribute
HTML <a> tag
Definition and Usage
The name attribute is an identification for the URL (web resource).
The name attribute can be used to link from one part of a page to another.
The href or the name attribute must be present in the <a> tag
Syntax
Syntax Example
Attribute Values
Value |
Description |
identifier |
The name/identifier of the link. Naming rules:
- Must begin with a letter A-Z or a-z
- Can be followed by: letters (A-Za-z), digits (0-9), hyphens ("-"),
underscores ("_"), colons (":"), and periods (".")
- Values are case-sensitive
|
Browser Support

The attribute is supported in all major browsers.
Example
Source |
Output |
<p><a name="example">Example</a></p>
|
Example
|
Try-It-Yourself Demos
a name attribute
example
How to use the name attribute to link to a location on the same page (an anchor).
HTML <a> tag
 |
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.
The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).
|
|