How to Create Scroll Indicator using HTML CSS and JavaScript ?

Scroll Indicator is a progress bar that represents how much a page has been scrolled. When we scroll down the bar fills up and when we scroll up the bar amount reduces.

Approach: Now, we will create a basic webpage with text to enable scrolling and then use JavaScript to make the scroll indicator work.