Below is the sample code to scroll down to the textarea using jquery and javascript :
Code to scroll to down in textarea with jQuery and javascript :
//using jquery
var textArea = $('#textarea');
textArea.scrollTop( textArea[0].scrollHeight - textArea.height() );
//using javascript
var textarea = document.getElementById('textarea');
textarea.scrollTop = textarea.scrollHeight;
var textArea = $('#textarea');
textArea.scrollTop( textArea[0].scrollHeight - textArea.height() );
//using javascript
var textarea = document.getElementById('textarea');
textarea.scrollTop = textarea.scrollHeight;
Click to jsfiddle with the example.
Note*: this example is tested on Google Chrome.
its not working with multiline textbox
ReplyDeleteCode in the above box is working fine.
ReplyDeleteThere is mistake in JSFiddle. Please check this updated JSFiddle http://jsfiddle.net/AR7EH/52/
Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog.
ReplyDeleteReally very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from javascript and jquery training in chennai .
or learn thru Javascript Training in Chennai.
Nowadays JavaScript has tons of job opportunities on various vertical industry. javascript and jquery training in chennai
You blog is information. I have a blog. I write posts about programing coding
ReplyDelete