HTML DOM Window scrollY Property Last Updated : 13 Aug, 2020 Comments Improve Suggest changes Like Article Like Report The scrollY property of the Window interface returns the number of pixels that the document is currently scrolled vertically in the current window. This value is subpixel precise in modern browsers, meaning that it isn't necessarily a whole number. This is a read-only property. Syntax: var Scry = window.scrollY Return Value: The returned value is a double-precision floating-point value indicating the number of pixels the document is currently scrolled vertically from the origin. Example: This example shows how to get the precise number of pixels that are being scrolled vertically of the document using this property. Here, we have attached a long vertical heading to exceed the frame to enable scroll vertically. HTML <!DOCTYPE HTML> <html> <body style="text-align:center;"> <h1 style="color:green;"> G<br> e<br> e<br> k<br> s<br> f<br> o<br> r<br> G<br> e<br> e<br> k<br> s<br> </h1> <p> HTML | window scrollY property </p> <button onclick="Geeks()"> Click Here </button> <p id="a"></p> <script> var a = document.getElementById("a"); function Geeks() { a.innerHTML = "scrollY is : " + window.scrollY; } </script> </body> </html> Output: Before Clicking the Button: After Clicking the Button: Supported Browsers: Google ChromeSafariFirefoxOperaEdge Comment More infoAdvertise with us Next Article HTML DOM Window scrollY Property T taran910 Follow Improve Article Tags : JavaScript Web Technologies HTML HTML-DOM Similar Reads HTML DOM Window scrollX property The scrollX property of the Window interface returns the number of pixels that the document is currently scrolled horizontally in the current window. This value is subpixel precise in modern browsers, meaning that it isn't necessarily a whole number. This is a read-only property. Syntax: var Scrx = 1 min read HTML DOM Window scrollMaxX Property The Window scrollMaxX property returns the maximum number of pixels that the document can be scrolled horizontally in the current window. Window scrollMaxX is a read-only property. Syntax: var Scrx = window.scrollMaxX Return Value: This property returns the maximum number of pixels that the document 1 min read HTML DOM scrollWidth Property The DOM scrollWidth property is used to return the width of an element. This property includes padding and also content that is not visible on the screen due to overflow but does not include a border, scrollbar, or margin. It is a read-only property. Syntax: element.scrollWidth Return Value: It retu 1 min read HTML DOM scrollTop Property The DOM scrollTop property is used to return or set the number of pixels an element is scrolled vertically. If the element's content doesn't generate a scroll bar, then its scrollTop value is 0. Syntax: It returns the scrollTop property.element.scrollTopIt is used to set the scrollTop propertyelemen 2 min read HTML DOM Window Scroll() Method The Window scroll() method scrolls the window to a particular place in the document. This method is different form scrollTo() method as it takes different parameters like scrolling behavior, etc using ScrolltoOptions Dictionary. Syntax: window.scroll(x-coord, y-coord) Or window.scroll(options) Param 2 min read Like