I have an element such as element = document.getElementyById("myElement");
Now, let us assume that there is some CSS applied on it through various methods such as #id, .class, and tagName.
We know that #id has priority over .class and .class has priority over tagName. I want to determine which of the above method is applied on that element i.e. I want to see if is has CSS applied on it using id, class, or tag. How would I find that out? Is there any JavaScript Library available for that?