Check if element with class of 'X' has a rel of 'N'
-
07-07-2021 - |
문제
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
}
해결책
try this;
If($(".selected").attr('rel') == '6'){ alert("ok"); }
다른 팁
제휴하지 않습니다 StackOverflow