jQuery [attribute〜 = value]セレクター

❮jQueryセレクター

特定の単語「nation」を含むname属性を持つすべての<input>要素を選択します。

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

定義と使用法

[attribute〜 = value]セレクターは、特定の文字列を含む値を持つ特定の属性を持つ各要素を選択します。

ヒント:文字列には空白を含めることができます。


構文

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

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

❮jQueryセレクター