Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Book said don't use CSS IDs, use class instead but what about when Javascript? Reply To: Book said don't use CSS IDs, use class instead but what about when Javascript?

#182346
shaneisme
Participant

Yeah @Senff, but reusability goes right down the toilet.

I much prefer classes, and JS specific ones at that.

div class="headline js-accordion-parent" would be an element that the classjs-accordion-parent does not appear in the stylesheets at all… this way they’re not connected and you can change one without affecting the other.