JSFiddle - React, Tailwind, and code Playground

by judeosborn

HTML

<input>

JavaScript

$('input').keypress(function(e) {
    if (e.keyCode === 97 && $(this).val().split('a').length > 1) {
        e.preventDefault();
    }
});