CKTIS / HTML
onscrollend — handling the end of scrolling
The onscrollend attribute assigns JavaScript code to the scrollend event, which signals that scrolling has finished. Distinguish the attribute name from the event name used with addEventListener().
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
onscrollend="JavaScript statements"
element.onscrollend = handler;
element.addEventListener("scrollend", handler);onscrollend is a global event handler attribute for scrollend. Its value is JavaScript code, not a Boolean value. Adding the attribute alone does not create a scrolling area; the example provides one through a constrained height and overflow:auto.
Distinguish the HTML attribute onscrollend, the JavaScript property element.onscrollend, and the event name "scrollend" passed to addEventListener(). HTML defines this handler for HTML elements and as a property of Document and Window objects.
In the example, scroll the box's contents and wait for scrolling to finish. The expected text is scrollend. To try the example, use a browser that supports this event. No interactive scrolling test was performed. The standard's index snapshot was consulted on 2026-11-18.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>onscrollend example</title>
<div id="box" tabindex="0" style="height:100px;overflow:auto"
onscrollend="document.getElementById('status').textContent = 'scrollend'">
<div style="height:400px">Scroll this box.</div>
</div>
<p id="status" role="status">Waiting</p>
</html>Result
scrollend
The status starts at `Waiting`. When the box fires `scrollend`, the handler changes it to `scrollend`. The isolated check covered the example's structure and whether the expected result follows from the code. The text change was not observed through interactive scrolling.