Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Reading Attribute Values From A Stylesheet

DZone's Guide to

Reading Attribute Values From A Stylesheet

·
Free Resource
Used for reading a value from the loaded stylesheet. Only support the usage of one stylesheet file. Supports selectors beeing grouped and defined in multiple blocks.


function getCssValue(selector,attribute)
   {
      selector = selector.toLowerCase();
      var stylesheet = document.styleSheets[0];
      var n = stylesheet.cssRules.length;
      for(var i=0; i
  
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}