How to retrieve CSS style object by CSS class name?
- by Chir
Hi,
Is it possible to get all properties of a css class associated with an element?
e.g.
.hightligh {
font-weight: bold;
border: 1px solid red;
padding-top:10px;
}
Lets say the css class "hightlight" is assigned to div element
<div class='highlight'></div>
Now using JavaScript, I need to iterate through all style properties of css class "highlight" associated with the div element.
Basically, I want to treat it as a JavaScript object whose properties can be accessed using iterator or for loop.
Thanks in advance