I have a div with a max-height
of 300px, causing a scrollbar to appear when the content exceeds this limit. I am seeking a way to click a button and automatically scroll to a specific element within that div. While I know how to manipulate the main browser scrollbar, I am uncertain if it is feasible to control the scrollbar generated for my div container.
This is the structure of my HTML:
<div style="min-height: 300px; max-height: 300px; overflow: hidden" class="card-block pt-0 pb-0">
<div class="row" style="min-height: 300px; max-height: 300px;">
<div class="col-5" style="overflow-y: auto; min-height: 300px;border-right: 1px solid rgba(0, 0, 0, 0.125); min-height: 300px; max-height: 300px;">
<div class="pt-3 pb-3" style=" max-height: 300px;">
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<div id="scroll-here">content</div>
</div>
</div>
</div>
</div>
Is it feasible to directly scroll to the div identified by the id "scroll-here"?
I am working with Angular 5 and Bootstrap 4, in case that information is relevant.