A simple question: why should we add the id
into our HTML tags if they work perfectly well without them? I know that one of their uses is being able to navigate
id
attributes in HTMLfor
attribute on
and
elements.
elements for the form
attribute on form associated elements.itemref
attribute.aria-describedby
, aria-labelledby
and 4 others. elements for the headers
attribute on and elements.
- As a target on
elements for the contextmenu
attribute.
- As a target on
elements for the list
attribute on
elements.
- As part of a hash-name reference to
elements for the usemap
attribute on the ![]()
and
elements.
- As an identifier of an element in a CSS selector
- As an identifier of an element for JavaScript processing
- 热议问题