scroll5.html 411 B

123456789101112131415161718
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <script>
  6. function dump(text) {
  7. document.getElementById('clicked').innerHTML = text;
  8. }
  9. </script>
  10. <div style='overflow: scroll; width: 150px; height: 200px; background-color: yellow' id="outer">
  11. <div style="width: 150px; height: 5000px; background-color: red;" onclick="dump('clicked')" id="inner">
  12. </div>
  13. </div>
  14. <div>
  15. Clicked: <span id='clicked'></span>
  16. </div>
  17. </body>
  18. </html>