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?
September 9, 2014 at 8:02 am
#182346
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.