Consider I have a list of questions. When I click on the first question, it should automatically take me to the bottom of the page.
For a matter of fact, I do know
A simple way if you want to scroll down specific element
Call this function whenever you want to scroll down.
function scrollDown() {
document.getElementById('scroll').scrollTop = document.getElementById('scroll').scrollHeight
}
ul{
height: 100px;
width: 200px;
overflow-y: scroll;
border: 1px solid #000;
}
- Top Here
- Something Here
- Something Here
- Something Here
- Something Here
- Something Here
- Something Here
- Something Here
- Something Here
- Something Here
- Bottom Here
- Bottom Here