KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need to check if a CSS rule exists because I want to issue some warnings if a CSS file is not included. What is the best way of doing this? I could filter through window.document.styleSheets.cssRules , but I'm not sure how cross-browser this is (plus I notice on Stack Overflow that object is null for styleSheet[0] ). I would also like to keep dependencies to a minimum. Is there a straightforward way to do this? Do I just have to create matching elements and test the effects? Edit: If not, what are the cross-browser concerns of checking window.document.styleSheets ?
Tags (comma-separated)
Save Edits
Cancel