jQuery [attribute~=value] Seletor

❮ Seletores jQuery

Exemplo

Selecione todos os elementos <input> com um atributo name que contenha a palavra específica "nation":

$("input[name~='nation']")

Definição e uso

O seletor [attribute~=value] seleciona cada elemento com um atributo específico, com um valor contendo uma string específica.

Dica: A string pode conter espaços em branco.


Sintaxe

$("[attribute~='value']")

Parameter Description
attribute Required. Specifies the attribute to find
value Required. Specifies the string value

❮ Seletores jQuery