This question is nearly identical, but differs in one crucial aspect and does not help ultimately: the sequence of style properties.
That is, two elements with the same style properties -- but in different orders -- should be considered equivalent.
Equality should also consider descendants, and apply this logic recursively. That is, two elements with the same descendants are equal if the only differences are the order of style properties. (This was implied previously under an outdated understanding of IsEqualNode, which considered children under an old spec but no longer does under the new spec.)
However, the highest-rated answer treats two such elements as different, as illustrated here:
<div style="color: red; font-size: 28px">TEST A</div>
<div style="font-size: 28px; color: red">TEST A</div>
if ($("div")[0].isEqualNode($("div")[1])) {
alert("Same");
} else {
alert("Different");
}
How could you recognize two HTML elements as equal if the only difference between them is the order of style properties?