HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ width:150px; height:150px; border:1px solid #8c8c8c; overflow: scroll; } </style> </head> <body> <div> <h3>Wildlife</h3> <p>Wildlife traditionally refers to undomesticated animal species, but has come to include all organisms that grow or live wild in an area without being introduced by humans.</p> </div> <p>Div is scrolled <span id="point">0</span> times</p> <script> var count = 0; var x = document.getElementsByTagName("div")[0]; function myFunction(){ count +=1; document.getElementById("point").innerHTML = count; } x.onscroll = myFunction; </script> </body> </html>
OUTPUT
×

Save as Private