JSFiddle - React, Tailwind, and code Playground

HTML

<input size="30" value="" >

<input size="30" value=""  >

JavaScript

jQuery("input").keypress(function() 
{   
   var key=window.event.keyCode;
   var allowed='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ :;,.?!ÂŁ$%^&*()_+-*{}@~<>&"\'';

    return allowed.indexOf(String.fromCharCode(key)) !=-1 ;
})