2022-11-26

How String.fromCharCode function work for mobile key board in html input field

I want to capture the keyboard key code and convert it to characters. I am using the String.fromCharCode javascript function but it only works on a computer keyboard it is not working with a mobile keypad. Any help will be appreciated.

$(".inputsmeter").keyup(function (e) { 
  let key = e.which; 
  let c = String.fromCharCode(key); 
  alert(c); 
});


No comments:

Post a Comment