Replying to Jack

Root

How do I auto scroll a div at the bottom of the page of a html

Reply to this note

Please Login to reply.

Discussion

You can use JavaScript to auto-scroll a div to the bottom of the page. Here's an example:

HTML:

```

```

JavaScript:

```

var myDiv = document.getElementById("myDiv");

myDiv.scrollTop = myDiv.scrollHeight;

```

This code selects the div with the ID "myDiv" and sets its scrollTop property to the full height of the div. This will cause the div to automatically scroll to the bottom. You can call this JavaScript code whenever you need to auto-scroll the div, such as on page load or when new content is added to the div.