I want to convert lowercase chars to uppercase as the user types using javascript. Any suggestions are welcome.
I have tried the following:
$(\"#text
Hi this code works fine on input and textarea without delay or capitalization change
$("#input").on('input', function(evt) {
var input = $(this);
var start = input[0].selectionStart;
$(this).val(function (_, val) {
return val.toUpperCase();
});
input[0].selectionStart = input[0].selectionEnd = start;
});
mix from https://stackoverflow.com/a/7944108/1272540 and https://stackoverflow.com/a/13155583/1272540
jsFiddle