JSFiddle - React, Tailwind, and code Playground

HTML

Nome: <input type="text" id="fnome">

JavaScript

$("#fnome").keyup(function(){
    
    var start = this.selectionStart,
        end = this.selectionEnd;
    
    $(this).val( $(this).val().toUpperCase() );
    this.setSelectionRange(start, end);
});