Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

set cursor to end of input

const el = this.editor.ngxWigEditable.nativeElement;
      setTimeout(() => {
        var range = document.createRange();
        range.selectNodeContents(el);
        range.collapse(false);
        var sel = window.getSelection();
        sel.removeAllRanges();
        sel.addRange(range);
      });
Source by github.com #
 
PREVIOUS NEXT
Tagged: #set #cursor #input
ADD COMMENT
Topic
Name
6+7 =