I am developing a basic web application using Jquery. In this application, I aim to restrict user input language. For instance, if a user enters the Russian letter б
in the input field, I want to automatically convert it to an English character. Below is a simplified example of what I am attempting:
$("#name").keyup(function() {
var charsObject = {
'а': 'a',
'б': 'b',
'г': 'g',
};
console.log($(this).val())
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="text" id="name">