JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" name="username" />
<!-- click on the input box and then press Shift+TAB and then start typing -->
JavaScript
$(document).ready(function(){
$('input[type="text"]').each(function(){
$(this).clone().insertAfter($(this));
$(this).css('margin-left', -($(this).width()));
//$(this).css('direction', 'rtl');
//direction: rtl
})
});
function reverse(s){
return s.split("").reverse().join("");
}
$('input[type="text"]').attr('maxlength', '15').attr('dir', "rtl").keyup(function() {
$('input[type="text"]').next().val(reverse($(this).val()));
})