I have an element which has two classes, and I want to get the class that wasn't used as a selector for this element. Exemple:
<div class="something anything"></div>
$(".something").attr("class");//Should return "anything"
$(".anything").attr("class");//Should return "something"
I am aware that .attr("class")
returns "something anything", it was just for the exemple.
I have made searches on SO to find an answer, like this one, but I cannot use an index to find the "other" class, because the one I need to retrieve may be the first one, or the second one. My element will never have more than two classes.
All notices appreciated to help me handle this. Thanks.