X5.3中經常使用到的jQuery整理

一、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屬性的元素css

相關文章
相關標籤/搜索