javascript
Scroll to the bottom of a div using Javascript
The code can be used to scroll to the bottom of a div using javascript. We are using scrollTop and scrollHeight properties of elements for this.
var my_div = document.getElementById("my_div");
my_div.scrollTop = my_div.scrollHeight;
Was this helpful?
Similar Posts
- Convert all characters to lowercase using toLowerCase() method in javascript
- Sort array using Array.sort() in javascript
- Get Pseudo elements using Javascript
- Add new item at first position of array using unshift() method Javascript
- open link in new tab using javascript
- Run a function every 5 seconds interval using Javascript
- Find the maximum value from an array using Javascript