I’m reading this basic tutorial on canvas elements. The (almost) in the following sentence caught my eye:
The id attribute isn’t specific to the element but is one of the default HTML attributes which can be applied to (almost) every HTML element
Which html elements cannot accept an id?
In HTML5, the
idattribute is a global attribute and can be specified on any element.If you look through the Document Type Declaration for HTML4, you can find the elements which do not have
%attrs;defined in their attribute list to indicate they do not support theidattribute. Those included are near the bottom in the “Document Head” section:HEAD,TITLE,BASE,META,STYLE,SCRIPT, andHTML.Note that although the
PARAMelement does not include the%attrs;declaration in its attribute list, it does explicitly allow theidattribute itself in that list.