Why is the id attribute needed when we have classes? : <p>Both <code>id</code> and <code>class</code> can be used to identify HTML elements. Any HTML element that can be identified with an ID could be similarly identified if you added the ID as a class instead. I can see some vague contours of a semantic reason why id and classes are both nice to have, but it hardly seems justifiable if we could do the exact same thing with one of them. Am I missing some important usages of <code>id</code> which cannot be done with <code>class</code>?</p>
