如何在jQuery中选择文档的根元素?
您可以使用以下方法来选择文档的根元素:
- 使用
document
对象和documentElement
属性来选择根元素。例如:
$(document.documentElement)
$("html")
About the author
William Pham is the Admin and primary author of Howto-Code.com. With over 10 years of experience in programming. William Pham is fluent in several programming languages, including Python, PHP, JavaScript, Java, C++.