JSFiddle - React, Tailwind, and code Playground
HTML
<input id="myId" style="width:50%;" value="0" type="text">
JavaScript
$("#myId").keypress(function(e) {
var x=e.charCode;
if (x == '49'){
e.preventDefault();
}
});
<input id="myId" style="width:50%;" value="0" type="text">
$("#myId").keypress(function(e) {
var x=e.charCode;
if (x == '49'){
e.preventDefault();
}
});