jQuery: How to distinguish between classes used for CSS and ones used for jQuery manipulation?
|Added at||2017-01-04 12:01|
Let's say I've the following code:
It's simple now, but when code becomes bigger, I find it difficult to distinguish between classes used just for CSS, and other classes used only for jQuery. For example:
Now when I look at the div with many classes, it's not easy to know which classes are used for CSS only, which are used for jQuery only, and which are used by both CSS AND jQuery.
The Question: Are there already approaches to avoid this issue? Or am I just overthinking about it?
I'm thinking of naming my classes based on usage, so for example classes used for CSS only would be named as "css_myclass1", classes used for jQuery only would be named as "jq_myclass2", and classes used for both would be named as "cssjq_myclass3".
NOTE: I know the answers might be opinion based, but I need to know what are the different approaches could be used, specially because I'm about to start a big project in which this simple issue might turn into a nightmare-code-complexity very quickly!