tom*_*msv 14 html jquery jquery-selectors document-root
我可以使用选择文档的正文和html部分
$('body')
Run Code Online (Sandbox Code Playgroud)
和
$('html')
Run Code Online (Sandbox Code Playgroud)
分别,但我如何选择文件根?
ade*_*neo 23
不确定你的意思,但选择你做的文件
$(document);
Run Code Online (Sandbox Code Playgroud)
要获取文档的内容,我猜你需要documentElement,这与<html>大多数环境中的标记相同.
$(document.documentElement);
Run Code Online (Sandbox Code Playgroud)