After reading up on the use of class and id, I really can not find anything that gives a reason/benefit of using id. With everything I tried, class worked just as good, so now I'm wondering why not always simply use class.Is there anything I missed where id offers a benefit over class?

An ID is more specific than a class, so if you have conflicting style rules (where two rules giving contradictory styles apply to the same element) then a rule that uses an ID will usually outrank a rule that just uses classes.

You can use an ID for an internal link (eg <a href="#section1"> jumps to the item with id="section1".

If you're using it as a Javascript hook, getElementByID is better supported than getElementByClass, so you should use an ID.

The class selector allows us to label related part of a HTML document. On the other hand, an id selector can be used to target individual elements. If you're still confused you may want to read this post.

Aside from ALL that has been said so far; an ID may also add a functionality hook for .js or serve to identify an input on a form, as in <label for="IDname"><input type='text' id='IDname' name='IDname> You MUST have that ID to link with the for attribute on the label.

Also serve as fragments. That is you can direct a link to an ID! <a href='#IDname'>Jumps to IDname </a>

The "side-effect" of explicit association is lots more ID attributes scattered throughout your forms

Also, the potential loss of not using explicit association is that people using the IE6 web browser won't be able to click on the text to select a form element, they will have to click on the form element instead, which I am okay with given the better maintainability that is found from using implicit association instead.

The "side-effect" of explicit association is lots more ID attributes scattered throughout your forms

I always avoid wrapping labels around the form controls as it has been documented to cause quite severe accessibility problems. Whether or not that is still true today I don't know but once you've learned a habit it sticks.:)

Another downside of wrapping the label is that you lose control over styling the text as you have no unique element to target and authors end up inserting a span which defeats the original purpose of that structure.

A class can be used several times, while ID can be used only once. ID is a unique identifier to an element.

Yes, I know that. The question was not what the deifinition is, but to give an example of a situation where the use of ID has a distinct advantage over the use of class. So far, it only seems to be with the use of input functions.