本页内容
上一节: Sel_visible 下一节: Jq_sel_lang

jQuery :root 选择器

jQuery 选择器

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


示例

$(":root").css("background-color","yellow");

定义和用法

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

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

Syntax

$(":root")

jQuery 选择器

上一节: Sel_visible 下一节: Jq_sel_lang
此页面最后编辑于2022年8月19日 (星期五) 11:38。