jQuery :root 选择器

jQuery 选择器 jQuery 选择器

实例

设置 HTML 文档的背景颜色为黄色:

$(":root").css("background-color","yellow");
尝试一下 »

定义和用法

:root 选择器选取文档的根元素。

在 HTML 中,根元素总是 <html> 元素。

Syntax

$(":root")

jQuery 选择器 jQuery 选择器

新闻动态 联系方式 广告合作 招聘英才 安科实验室 帮助与反馈 About Us

Copyright © 2013 - 2019 Ancii.com All Rights Reserved京ICP备18063983号-5 京公网安备11010802014868号