Skip to main content
@spa-tools/utilities

scrollToBottom()

The scrollToBottom() function immediately scrolls to the bottom of a given element.

Usage

import { scrollToBottom } from '@spa-tools/utilities';

// select the element
const myElement = document.querySelector('#myElement');

// do it!
scrollToBottom(myElement);

Arguments

NameTypeDescription
elHTMLElementThe element to scroll bottom to

Returns

void