Home >Web Front-end >JS Tutorial >The newly added content is how to automatically move the scrollbar of the div to the bottom_javascript skills
Sometimes when we make dynamically growing divs, we usually append the content to the bottom of the div, but this will bring about a rather painful problem, that is, the newly added content will be hidden at the bottom, like this
How to make the scrollbar automatically move to the bottom? This requires the help of js. Assume that the id of the div is myDiv, then use the native js to implement the following: