What does $("html")
mean?
i.e. $("html").scrollTop(0);
What does $("html")
mean?
i.e. $("html").scrollTop(0);
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)
.