Check if element with class of 'X' has a rel of 'N'
-
07-07-2021 - |
Question
If you have an element with a certain class, for example class="selected"
and need to see if it has a certain rel value, how would one do that?
In basic logic:
If('.selected' has 'rel=6'){
//action
}
Solution
try this;
If($(".selected").attr('rel') == '6'){ alert("ok"); }
OTHER TIPS
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow