首页 > 选择器 > :root
返回值:jQuery:root
V1.9概述
选择该文档的根元素。
在HTML中,文档的根元素,和$(":root")选择的元素一样, 永远是<html>元素。
示例
设置<html>背景颜色为黄色
$(":root").css("background-color","yellow");
↑
选择该文档的根元素。
在HTML中,文档的根元素,和$(":root")选择的元素一样, 永远是<html>元素。
设置<html>背景颜色为黄色
$(":root").css("background-color","yellow");