If possible, I think what should happen is this
build the structure of the site in HTML
add styling with CSS (here's where the classes are added)
hook javascript via already created classes and IDs
add additional classes/IDs only where necessary.
In most cases this keeps it all wrapped together nicely.
If the scripting is done last (which I think is best), the structure should be there to support it.
So, in almost all cases your js classes/IDs would mirror your CSS stuff.
EDIT
To provide additional info as per @Bryce Siedschlaw's comment:
Most of my classes/IDs are based on the element's function. Some examples of rules I created/modified today
#successExplain{}
.successImgs{}
.continueRead{}
.continueRead a{}
.continueRead a:hover{}
#tagCloud{}