Browser back button in Little Closet" template

<button onclick=”goBack()”>Go Back</button>
<script>
function goBack() {
window.history.back();
}
</script>

When you press the button or even hit the browser back button, the page goes back to the previous page and page position, but only for a moment, then it scrolls to the top of the page. Is there a way to stop the page from scrolling to the top. It is when the product.php page re-calls the category.php page. If I have 500 products and am viewing product 200, I want to return to the same spot on the page. Is there something in you script that over rides the goBack() function?

Thanks Rick

Good evening

Can you show me where this is happening? please provide link to the page and i will check it

Thanks for the quick response! Anyway here is a link to my product list page
https://clickforadeal.com/new_cfad/product_list.php?p_shop_name=rct%20estate%20sales

Scroll down until you see some assorted dishes and click the text that says assorted dishes. This brings you to the product detail page. Now, near the top left there is a link called “All” with a little tag next to it. This link brings you back to the product_list.php page, and I want it to " function goBack()" to the same spot on the page, which would be the assorted dishes.

Also I just purchased the one license template. I have been playing with it for a few days and love the template. I am converting my website to this new format “layout” so please forgive any broken links. I am not done yet, in fact I have a ton of coding to do to convert.

And one last question, Is this the correct forum for my questions? As I am completely new to Colorlib

Good morning

OK now I understand your question, unfortunately this is not possible, when navigated to product page from product lists you can’t use “all” link on product page to go back on the same screen, because “all” link is for product list page and not “go back on current view” ts dry link and nothing else, however if you use browser go back button it will send you on the same location on product list page
Yes, this is the correct place for your questions