小白教程
所有教程
关于
Search
172.69.58.199
172.69.58.199
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Jq sel root”的源代码
本页内容
上一节:
Sel_visible
下一节:
Jq_sel_lang
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE::root}}[[Category:jquery ref selectors|38]] = jQuery :root 选择器 = [[jquery ref selectors|jQuery 选择器]] 设置 HTML 文档的背景颜色为黄色: <sample title="" desc="" lang="html" hererun="1"> $(":root").css("background-color","yellow"); </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $(":root").css("background-color","yellow"); }); </script> </head> <body> <h1>这是一个标题</h1> </body> </html> </run> == 定义和用法 == :root 选择器选取文档的根元素。 在 HTML 中,根元素总是 <html> 元素。 == Syntax == $(":root") [[jquery ref selectors|jQuery 选择器]]
返回至“
Jq sel root
”。
上一节:
Sel_visible
下一节:
Jq_sel_lang