JSFiddle - React, Tailwind, and code Playground
HTML
<input>
JavaScript
$('input').keypress(function(e){
console.log(e.keyCode);
console.log($(this).val());
if ((e.keyCode === 65 || e.keyCode === 97) && $(this).val().match('/a/i')) console.log('cancel');
})