Check if element with class of 'X' has a rel of 'N'
-
07-07-2021 - |
Pergunta
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
}
Solução
try this;
If($(".selected").attr('rel') == '6'){ alert("ok"); }
Outras dicas
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow