HTML onscroll Attribute

❮ HTML Attributes

Example

<div id="myDIV" onscroll="myFunction()">

Meaning

The onscroll attribute specifies the script to be run when an element's scrollbar is being scrolled.




Standard Syntax

<element onscroll="script">



Browser Support




Status




Applies to:

The onscroll attribute can be used on the following element:

Element Attribute
All HTML elements. onscroll






Attribute Values

Value Description
script Specifies the script to be run on onscroll.
❮ HTML Attributes