Create a "Scroll To Top" Button with HTML, CSS & JavaScript | Web Design Tutorial


In this video we’re going to create a “Scroll To Top” button using plain HTML, CSS and JavaScript – this is super easy to do and it is completely optional to use a library to achieve this.

While not necessary, I’m using Google Material Icons in this video along with jQuery for greater cross-browser support.

Google Material Icon Set:

Support me on Patreon:
– with enough funding I plan to develop a website of some sort with a new developer experience!

For your reference, check this out:

Follow me on Twitter @dcode!

If this video helped you out and you’d like to see more, make sure to leave a like and subscribe to dcode!

#css #javascript #dcode


Xem thêm bài viết khác:


  1. it works fine for me if I write the javascript in the html file , but not when I use an external JS file , any idea as to why ?

  2. sir I want an autoscroll button which scrolls in a lesser pace how can I restrict the scroll button to scroll slowly .
    Can you please help me out sir

  3. Hi I'm just starting with html and css so if my question is weird. But what is difference between this icon function done by JS and #anchor link? Thank you for answer 🙂

  4. What a brilliant video, I'm a real novice to JS and you explained this so easily. Thank you for your video, I was able to add a nice scroll button to my website with a gradient background color for a bit of a 3d effect. Thanks again, I'm a new subscriber!

  5. I ve got only one question: how would you embed this functionality to every single page of your website?
    You definitely wouldnt want to copy-paste this code on every page separately.
    By the way,great tutorial,as usual !
    Im a big fan

  6. hey man.. thanks for this tutorial. you are doing a great job. i just subscribed to your channel. can you do a video on on scroll animations? like @keyframes acting up when the window is scrolled.. thanks

  7. Nice video but do you know if i can use my own scroll top button done on AI and not the one from google ?

  8. La verdad es que dispones de un muy buen contenido me estoy viciando viendo tus vídeos y aprendiendo y expandiendo mis conocimientos sigue así tienes talento para esto Gracias y un saludo


Please enter your comment!
Please enter your name here