A unique challenge has presented itself with a div called #results that appears when words are entered into a text box, triggering relevant results. This particular div is fixed and scrollable, with pagination located at the bottom of the scroll. The issue arises when clicking on a page number (.gotoPage). Instead of loading the subsequent page within the fixed div as intended, the entire site content scrolls up behind it. This behavior is not desired, especially since there is an #search-top element positioned at the top of the results where the focus should be. Is there a way to ensure that only the results div scrolls up without affecting the rest of the site?
$( ".gotoPage" ).click(function() {
var container = document.getElementById('results');
var scrollTo = document.getElementById('search-top');
container.scrollTop = scrollTo.offsetTop;
});