Can id attributes only be used on <div> tags?



In this exercise we give multiple <div> tags an id. Can any opening <html> tag have an id attribute or can only opening <div> tags have this attribute?


Any opening <html> tag can have an id attribute. While the id attribute defines an identifier which should be unique to the whole document, it is not uncommon for several different <html> tags to have unique id attributes. To find out which attributes are available to every tag, take a look at this list of global attributes.

FAQ: Learn HTML Elements - Intro to HTML - Attributes