jQuery: find element with an href of X
-
23-06-2021 - |
Pergunta
I need to be able to check the following:
$(".main-menu a")
For a specific href
attribute and then addClass
Solução
$(".main-menu a[href='http://somesite.com']").addClass('someClass');
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow