id attribute provides a unique identifier for an element within the document. It may be used by an a element to create a hyperlink to this particular element.
Note that the id attribute cannot be applied to the following elements:
<span id="thisspan">A uniquely identifiable element.</span>
The most important aspect of the
id attribute is that it must be absolutely unique. Unlike the class attribute, which may apply the same value to many elements in a page, an
id that’s applied to an element must not match an
id used anywhere else on the same page.
id attribute value must begin with a letter in the roman alphabet (a–z or A–Z); this can be followed by any combination of letters (a–z or A–Z), digits (0–9), hyphens (-), underscores (_), colons (:), and periods (.). The id value is case sensitive, thus
<span id="me">This is me</span> and
<span id="ME">This is me</a> would be considered to be separate and uniquely identifiable elements on the same web page.