If I have an element -
<div class="myDiv"></div>
myDiv has some rules applied to it -
.myDiv {
background:red;
}
I then apply another class to myDiv -
$('.myDiv').addClass('newClass');
There's a definition in my css like this -
.myDiv.newClass{
position:relative;
left:20px;
}
How can I find out what rules apply specifically to $('.myDiv.newClass')? I would like a function that returns an object with the css rules in.
The result would be something like this -
{
"position":"relative",
"left":"20px"
}