HTML onscroll Attribute
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">
Applies to:
The onscroll attribute can be used on the following element:
| Element | Attribute |
|---|---|
| All HTML elements. | onscroll |
Advertisement
Attribute Values
| Value | Description |
|---|---|
| script | Specifies the script to be run on onscroll. |