Javascript examples for DOM HTML Element:Textarea
Scroll Textarea to the bottom
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// w ww . j a v a2s. c om var textarea = document.getElementById('textarea_id'); setInterval(function(){ textarea.value+=Math.random()+'\n'; textarea.scrollTop = textarea.scrollHeight; }, 1000); } </script> </head> <body> <textarea id="textarea_id" columns="10" rows="5"> </textarea> </body> </html>