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

❮jQueryセレクター

「.org」で終わるhref属性を持つすべての<a>要素を選択します。

$("a[href$='.org']")

定義と使用法

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


構文

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

Parameter Description
attribute Required. Specifies the attribute to find
value Required. Specifies the string the value should end with

❮jQueryセレクター