JSFiddle - React, Tailwind, and code Playground
by Apple Ilagan
HTML
<form>
<input type="text" name="yourInput" onkeypress="return
testForApostrophe(event);">
<button id="other">
Trigger the handler
</button></form>
JavaScript
function testForApostrophe(e) { // KEYPRESS event
var k;
if (e && e.which) { // NS
k = e.which;
} else if (window.event && window.event.keyCode) { // IE
k = window.event.keyCode;
}
return (!k || k != 39);
}