Answers for "move cursor to end of input javascript"

1

move cursor to end of line javascript

<input type="text" id="yourId" onfocus=" let value = this.value; this.value = null; this.value=value" name="nameYouWant" class="yourClass" value="yourValue" placeholder="yourPlaceholder...">
<script>
    document.getElementById("yourId").focus()
</script>
Posted by: Guest on May-11-2020
0

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);
      });
Posted by: Guest on May-24-2021

Code answers related to "move cursor to end of input javascript"

Browse Popular Code Answers by Language