Definition of HTML "anchor"
An anchor in an HTML document is a named location (bookmark) that can be referenced by a URL, usually coded in an href
attribute or src
attribute of an HTML tag. The location is named by the id
attribute of the HTML tag at the target location. When a user clicks on the link, most browsers will automatically scroll a web page to the location of the target anchor on the page.
Changes in HTML 5
In previous versions of HTML, an <a> tag with a name
attribute but no href
was used for anchors in HTML code. In HTML 5, the id
attribute for the target location can be coded on most HTML tags.