Skip to content

Get all the css rules from a class or id or all rules that apply to an element.

License

Notifications You must be signed in to change notification settings

webciter/getCSSRules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

getCSSRules

Get all the css rules from a class or id or all rules that apply to an element.

It's nice and clean output it, could be used for debugging purposes, by sending to server etc.

var element = document.getElementById("test");

element.id = "test_id";
element.classList.add("class_one class_two");

var a = element.getCSSRules("class_two"); /* class_two only class_one is skipped */
var b = element.getCSSRules(null, "test_id"); /* id only */
var c = element.getCSSRules(); /* all rules included cascaded */

About

Get all the css rules from a class or id or all rules that apply to an element.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published