Tidy 60

From Htmlpedia
Jump to: navigation, search

Tidy: ... id and name attribute value mismatch

Cause:

NAME and ID are the old and the new name for the same attribute. If both are defined, they should be equal. Use id (new) or name (old):

  • The id attribute shares the same name space as the name attribute when used for anchor names.
  • The id attribute can act as more than just an anchor name (e.g., style sheet selector, processing identifier, etc.).
  • Some older user agents don't support anchors created with the id attribute.
  • The name attribute allows richer anchor names (with entities).

Example:

Define the name=id or just id.

Bad<a name="abcdef" id="ghijklm">
Good<a name="abcdefgh" id="abcdefgh">
Good<a id="abcdefgh">

Solution:

Remove one of the both attribute or make the 2 values of ID and NAME equal

References: