X5.3中常用到的jQuery整理

ecoolper發表於2016-05-05

1、jQuery選擇器

$(`*`).css(`background`,`red`); //選擇本頁所有元素
$(this.getElementByXid(“div1”)).css(`background`,`red`); //選擇Xid值為div1的元素
$(`li`).css(`background`,`red`); //返回所有li元素請輸入程式碼
$(`.x-col-10`).css(`background`,`red`); //返回所有class類為.x-col-10的元素
$(“.x-titlebar-left”).css(`background`,`red`); //返回class為x-titlebar-left的元素
$(“[src]”).css(`width`,`290px`); //返回所有帶src屬性的元素

相關文章