To set Caret Position at the end of text in textbox or textarea

jQuery.fn.putCursorAtEnd = function() {
return this.each(function() {
// Cache references
var $el = $(this),
el = this;
// Only focus if input isn’t already
if (!$“:focus”)) {
// If this function exists… (IE 9+)
if (el.setSelectionRange) {
// Double the length because Opera is inconsistent about whether a carriage return is one character or two.
var len = $el.val().length * 2;
// Timeout seems to be required for Blink
setTimeout(function() {
el.setSelectionRange(len, len);
}, 1);
} else {
// As a fallback, replace the contents with itself
// Doesn’t work in Chrome, but Chrome supports setSelectionRange
// Scroll to the bottom, in case we’re in a tall textarea
// (Necessary for Firefox and Chrome)
this.scrollTop = 999999;

This sets the cursor or caret at the end but doesn’t scroll that caret/cursor into view… to achieve that u shall use text_box.scrollLeft = 999999 which scrolls the view into cursor.
Before setting the scrollLeft, ensure that the focus is set on the input field

Window.load Vs document.load

Window loads after document
Window includes HTML code + associated elements like images.

If multiple document.load and window.load is written then the order of the script will be taken into account by the browser.

Vertical-align pushes div

When vertical-align : middle pushes the inner div outside the parent/container, you can fix it by adding “overflow: hidden” for the parent/container. This is automatically handled in Chrome browser and the issue arises only with IE…Even IE11

Auto Scoll for div

advanced:{ autoScrollOnFocus: “input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable=’true’], div” } –> div will not be available by default.

External Supporting info:

jQuery custom content scroller

[I am not the owner of any of the mentioned source code ]