Learn html - html tutorial - Onscroll attribute in html - html examples - html programs
- The onscroll attribute triggers when the element’s scrollbar is being scrolled.
- onscroll attribute is the part of the event attribute.
Syntax for onscroll attribute in HTML:
Differences between HTML 4.01 and HTML5 for onscroll attribute:
HTML 4.01
- HTML4 does not support onscroll attribute.
HTML 5
- HTML5 supports onscroll attribute.
Applies To:
Element |
Attribute |
All Visible elements |
onscroll |
Attribute Values:
Value |
Description |
script |
The script can run on onscroll |
Sample Coding for onscroll Attribute in HTML:
Code Explanation for onscroll Attribute in HTML:
- “myDIV” is used to apply styles to the
element.
- <div id=”myDIV”> is used to display block of contents with specified style.
- The onscroll attribute is used to call OnScroll() JavaScript function when the content inside the scrollbar is scrolled.
- The JavaScript function OnScroll() is used to display the content in blue color when scrolled.
Output for onscroll Attribute in HTML:
- The output shows the contents.
- When user scroll downwards the text turns into blue color.
Browser Support for onscroll Attribute in HTML:
Related Searches to onscroll Attribute in html
onscroll Attribute
div onscroll not firing
window.onscroll javascript
angular onscroll
jquery on scroll down
onscroll react
addeventlistener scroll
ng-scroll
scroll event not firing
html attributes
html tutorialshtml editor html code html form html tutorial html color html color codes html table html img html5 html code for website html and css html programs html website free html editor html5 tutorial wysiwyg html editor html tutorial pdf html converter php tutorial html example html tutorial css tutorial html css html tags html basics code html html online html mailto html lang html tags list