JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" name="change" value="Hello World" autofocus />

JavaScript

var input = $('input[name="change"'),
    strLen = input.val().length;
input.val(input.val());
input.focus();
input[0].setSelectionRange(strLen, strLen);