JSFiddle - React, Tailwind, and code Playground

by Qwerty_Wasd

HTML

<input id="edt" type="text" value="12345" />
<button id="btn">Установить курсор в конец строки поля ввода</button>

JavaScript

jQuery(function($){
    $('#btn').click(function(){
        var el=document.getElementById('edt');
        el.focus();
        el.setSelectionRange(el.value.length,el.value.length);
    });
    $('#edt').focus()
});