The question is published on by Tutorial Guruji team.
I have a project that has a chat app that looks like this:
as you can see the scroll bar is not in the window, it is at the chat section, what I want to do is to scroll automatically down of the chat section. I try doing this:
but that doesn´t work, is there another way to only scroll down only the chat section?
As I can see on the screenshot, you need to scroll the chat section, not the whole window.
const chatContainer = document.querySelector("#chat-container"); chatContainer.scrollTo(0, chatContainer.scrollHeight)