I am writing a reusable .NET / Sitecore control that spills out some HTML elements with specific CSS classes. I would like to provide a set of default CSS definitions for these classes, but only if there was nothing in the page load, will it allow default formatting, but for this it will be redefined outside the control.
Is there a reliable cross-browser way, preferably without jQuery, to determine in JavaScript whether a previously existing CSS class definition exists?
You should look at document.styleSheets
, , ... CSS : "". , ( ) . , CSS, ( CSS, , , prio , ).
, , - , . javascript , ( , , , ...).
, , javascript .