YouTip LogoYouTip

Att A Name

# HTML `` name Attribute The `name` attribute of the `` (anchor) tag was historically used to define a named anchor (bookmark) within an HTML document. This allowed users to jump directly to a specific section of a page using a hyperlink. --- ## Introduction In older versions of HTML (such as HTML 4.01), the `name` attribute was the standard way to create internal bookmarks within a webpage. When a user clicked a link pointing to that anchor, the browser would automatically scroll the page to the position of the named anchor. > **Important Note:** The `name` attribute on the `` tag is **deprecated** in XHTML and **no longer supported** in HTML5. Modern web development uses the global `id` attribute on any HTML element to achieve the same functionality. --- ## Syntax ```html Link Text or Destination ``` ### Attribute Values | Value | Description | | :--- | :--- | | *anchor_name* | Specifies the unique name of the anchor. | --- ## Code Examples ### Legacy Method (Using the `name` Attribute) This example demonstrates how the `name` attribute was traditionally used to create a bookmark and link to it. ```html Chapter 4: Advanced Techniques

This is the content of Chapter 4...

Jump to Chapter 4 ``` ### Modern Method (Using the `id` Attribute) Because the `name` attribute is obsolete in HTML5, you should use the `id` attribute on any block or inline element instead. ```html

Chapter 4: Advanced Techniques

This is the content of Chapter 4...

Jump to Chapter 4 ``` --- ## Browser Support | Feature | Chrome | Edge/IE | Firefox | Safari | Opera | | :--- | :--- | :--- | :--- | :--- | :--- | | `name` Attribute | Yes (Legacy) | Yes (Legacy) | Yes (Legacy) | Yes (Legacy) | Yes (Legacy) | All major browsers still support the `name` attribute for backwards compatibility with legacy websites. However, relying on it for new projects is highly discouraged. --- ## Key Considerations & Best Practices 1. **HTML5 Deprecation:** Do not use `` in modern web development. Use the global `id` attribute on elements like `

` to `

`, `
← Att A RelAtt A Media β†’