The ID attribute uniquely identifies an element within a document. No two elements can have the same ID value in a single document. The paragraphs in the example could have style rules associated with them through their ID attributes. Since ID and NAME share the same name space, authors cannot use the same value for an ID attribute and a NAME attribute in the same document. Also note that while NAME may contain entities , the ID attribute value may not.
Classes allow authors to define specific kinds of a given element.
Unlike with the ID attribute, any number of elements can share the same class. Note that most current browsers do not support multiple classes. The LANG attribute specifies the language of an element's attribute values and its content, including all contained elements that do not specify their own LANG attribute. While the LANG attribute is not widely supported, its use may help search engines index a document by its language while allowing speech synthesizers to use language-dependent pronunciation rules. As well, visual browsers can use the language's proper quotation marks when rendering the Q element.