jQuery: What does $("html") mean?
What does $("html")
mean?
i.e. $("html").scrollTop(0开发者_JAVA百科);
It means to select the <html>
element in the page, and scroll to it's top position. Since that's the very top of the document, you're scrolling the browser all the way up.
$("html")
selects all elements of the type html
. And that’s the root element in HTML. The same can be done with $(document)
or$(document.documentElement)
.
精彩评论