JSFiddle - React, Tailwind, and code Playground

by Murat Kezli

HTML

<label class="nasilmis-net">Bütün Harfleri Türkçe olarak Büyük Harf Yap</label><br/>
<input class="nasilmis-net cerceve" type="text" onkeyup="this.value=this.value.nasilmisnet()">

CSS

.nasilmis-net{
    width:80%;
    height:20px;
    padding:10px;
    border-radius:0px; 
    font-size:14px; 
    color:rgba(146,0,3,1.00); 
    outline:none;
}
.cerceve{border:solid 1px gray; }

JavaScript

String.prototype.nasilmisnet=function() {

var str = [];
for(var i = 0; i < this.length; i++) {
var ch = this.charCodeAt(i);
var c = this.charAt(i);
if(ch == 105) str.push('İ');
else if(ch == 305) str.push('I');
else if(ch == 252) str.push('Ü');
else if(ch == 351) str.push('Ş');
else if(ch == 246) str.push('Ö');
else if(ch == 231) str.push('Ç');
else if(ch >= 97 && ch <= 122) str.push(c.toUpperCase());
else if(ch == 287) str.push('Ğ');
else str.push(c);
}
return str.join('');
}