Get offset of how much textarea is scrolled - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Textarea

Description

Get offset of how much textarea is scrolled

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/* www. j  a v  a2 s  .c  o m*/
document.getElementById("b").onclick = function() {
    console.log(document.getElementById("t").scrollTop);
};
    }

      </script> 
   </head> 
   <body> 
      <textarea id="t" rows="10" cols="10"></textarea> 
      <button id="b">scrollTop</button>  
   </body>
</html>

Related Tutorials