How to make a button scroll down page in HTML?

后端 未结 2 1213
太阳男子
太阳男子 2021-02-13 20:52

Couldn\'t find a tutorial for this anywhere or just didn\'t use the right keywords. I\'m making a one-paged website, and I\'d like the navigation bar buttons to scroll the page

2条回答
  •  灰色年华
    2021-02-13 21:37

    using window.scrollTo you can scroll down your page like this

    window.scrollTo(0,document.body.scrollHeight);
    

提交回复
热议问题