“Stop Using CSS Selectors for Non-CSS” https://css-tricks.com/stop-using-css-selectors-non-css/
The advice is not to hang behaviour (i.e. JS and related) off the selectors you use for styles but off custom attribute selectors ('data-'). It's good advice.