Javascript examples for DOM HTML Element:Textarea
Scroll textarea to top
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w ww.j av a2s. co m*/ document.getElementById("b").onclick = function() { document.getElementById("t").scrollTop= 13; console.log(document.getElementById("t").scrollTop); }; } </script> </head> <body> <textarea id="t" rows="10" cols="10"> asd asdf asd fa sdf a sdfa sd fa sdf asd fa sd fa sdf asd fa sd f</textarea> <button id="b">scrollTop</button> </body> </html>