How to make a scrolling div?

Good afternoon. How to make scrolling inside DIV with JQuery?
There is a div with overflow-y auto.
I need when a lot of div elements, adding new was automatically scrolling to the bottom of the unit.
March 23rd 20 at 19:22
1 answer
March 23rd 20 at 19:24
Solution
$('my-div').stop().animate({
 scrollTop: $('my-div').prop('scrollHeight') - $('my-div').height()
}, 1000);
Wrong.
For overflow-y auto - Euna_Pfeffer commented on March 23rd 20 at 19:27
@Euna_Pfeffer, - wallace_Hermist commented on March 23rd 20 at 19:30

Find more questions by tags jQuery