JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" id="ch" />
<input type="text" id="myinp" />

JavaScript

$(document).ready(function() {
        $('input').keyup(function() {
            if( $("#ch").is(":checked") ) {
                this.value = this.value.toLocaleUpperCase();
            }

        });
    });