Scroll to the top of the page using JavaScript

0 votes
How do I scroll to the top of the page using JavaScript? The scrollbar instantly jumping to the top of the page is desirable too as I'm not looking to achieve smooth scrolling.
Jun 9, 2022 in JQuery by Anchal
• 320 points
552 views

1 answer to this question.

0 votes

The scrollTo() method of the window Interface can be used to scroll to a specified location on the page. It accepts 2 parameters the x and y coordinate of the page to scroll to. Passing both the parameters as 0 will scroll the page to the topmost and leftmost poin

answered Jun 10, 2022 by gaurav
• 23,260 points

Related Questions In JQuery

0 votes
1 answer
0 votes
1 answer

How to scroll to element from bottom to top with a nice animation using Jquery?

Hello @kartik, Assuming you have a button with ...READ MORE

answered Sep 10, 2020 in JQuery by Niroj
• 82,840 points
4,251 views
0 votes
1 answer

How to get the size of the screen, current web page and browser window?

Hello @kartik, You can get the size of ...READ MORE

answered Sep 10, 2020 in JQuery by Niroj
• 82,840 points
514 views
0 votes
1 answer

How to Get the real width and height of an image with JavaScript?

Hello, Webkit browsers set the height and width ...READ MORE

answered Nov 25, 2020 in JQuery by Niroj
• 82,840 points
692 views
0 votes
1 answer

Smooth scrolling when clicking an anchor link

document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', ...READ MORE

answered Jun 20, 2022 in JQuery by rajatha
• 7,680 points
2,204 views
0 votes
1 answer

Smooth scroll to div id jQuery

You need to animate the html, body $("#button").click(function() { ...READ MORE

answered Jun 23, 2022 in Web Development by rajatha
• 7,680 points
3,233 views
0 votes
0 answers

Scroll to an element with jQuery

I have this input element: <input type="text" class="textfield" ...READ MORE

Jul 1, 2022 in Web Development by gaurav
• 23,260 points
503 views
0 votes
0 answers

How to scroll to top of page with JavaScript/jQuery?

Is there a way to control browser ...READ MORE

Jul 1, 2022 in Web Development by gaurav
• 23,260 points
2,254 views
0 votes
1 answer

Opposite to jQuery's .Closest (Top/Far-Most?)

.menu .sub - menu ...READ MORE

answered May 30, 2022 in JQuery by gaurav
• 23,260 points
681 views
0 votes
1 answer

What is the difference between AJAX with JavaScript and jQuery?

JavaScript is a programming language. JQuery is ...READ MORE

answered May 30, 2022 in JQuery by gaurav
• 23,260 points
798 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP