JSFiddle - React, Tailwind, and code Playground

by Ufuk Ozdemir

HTML

<input type="text" class="text-uppercase" style="width: 400px; height: 40px; font-size: 16px" />

JavaScript

$('.text-uppercase').keyup(function() {
    $(this).val($(this).val().replace(/^([a-zA-Z\s\ö\ç\ş\ı\i\ğ\ü\Ö\Ç\Ş\İ\Ğ\Ü])|\s+([a-zA-Z\s\ö\ç\ş\ı\i\ğ\ü\Ö\Ç\Ş\İ\Ğ\Ü])/g, function ($1) {
        if ($1 == "i")
            return "İ";
        else if ($1 == " i")
            return " İ";
        return $1.toUpperCase();
    }));
});