:root选择器选择文档的根元素(始终为<html>)。
语法:
$(":root")
实例
选择根元素:
$(document).ready(function(){
$(":root").css("background", "lightgreen");
});
测试看看‹/›jQuery :even 偶数选择器 jQuery :odd 奇数选择器
展开全部
:root选择器选择文档的根元素(始终为<html>)。
$(":root")
选择根元素:
$(document).ready(function(){
$(":root").css("background", "lightgreen");
});
测试看看‹/›jQuery :even 偶数选择器 jQuery :odd 奇数选择器