jQuery [attribute] 選擇器

jQuery 選擇器 jQuery 選擇器

實例

選取帶有 id 屬性的每個元素:

$("[id]")


定義和用法

[attribute] 選擇器選取帶有指定屬性的每個元素。


語法

$("[attribute]")

參數 描述
attribute 必需。規定要查找的屬性。


jQuery 選擇器 jQuery 選擇器