Is there a way to determine whether or not a css class exists using JavaScript?
This should be possible to do using the document.styleSheets[].rules[].selectorText and document.styleSheets[].imports[].rules[].selectorText properties. Refer to MDN documentation.
document.styleSheets[].rules[].selectorText
document.styleSheets[].imports[].rules[].selectorText
1.4m articles
1.4m replys
5 comments
57.0k users