Scrollbar focus on the bottom of the HTML div


How do I make this scrollbar focus on the bottom of this div. Does JavaScript is necessary?

Simple chat box


You can try this:

var objDiv = document.getElementById("your_div");
objDiv.scrollTop = objDiv.scrollHeight;

Answered By – Fotis Grigorakis

Answer Checked By – Pedro (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.