For example if I wanted to select some elements with a certain class using jQuery, and for that reason only, is it always expected that those classes SHOULD be defined in the css?.
<div class="xyz">
something
</div>
<div class="xyz">
something else
</div>
//with example jQuery
$(".xyz").hide();
//is it wrong no element 'xyz' is defined in css?
Using CSS classes and – depending on the case – IDs (unique!!) is perfectly fine and often the only solution to keep your HTML code valid while giving additional attributes used by scripts.
While using non-standard attributes often works fine, too, it will prevent your html code from validating and might cause issues in the future.
However, for some cases there might be attriutes which can be used, too – like
relon links which is often used for scripts which modify link behaviour.http://www.w3.org/TR/html401/struct/global.html#h-7.5.2 also mentions that class is general-purpose: