Horje
Place cursor at the end of the text Code Example
Place cursor at the end of the text
function placeCaretAtEnd(el) {
    el.focus();
    if (typeof window.getSelection != "undefined"
            && typeof document.createRange != "undefined") {
        var range = document.createRange();
        range.selectNodeContents(el);
        range.collapse(false);
        var sel = window.getSelection();
        sel.removeAllRanges();
        sel.addRange(range);
    } else if (typeof document.body.createTextRange != "undefined") {
        var textRange = document.body.createTextRange();
        textRange.moveToElementText(el);
        textRange.collapse(false);
        textRange.select();
    }
}

placeCaretAtEnd( document.querySelector('p') );




Whatever

Related
Creating a model - Contact Code Example Creating a model - Contact Code Example
nlkjlkjkl Code Example nlkjlkjkl Code Example
@android:color/system_neutral1_1000 Code Example @android:color/system_neutral1_1000 Code Example
google kubernetes engine Code Example google kubernetes engine Code Example
interface a or b Code Example interface a or b Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8