JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" onkeydown="doit(event)" />
<script>
function doit(e) {
e.preventDefault();
}
</script>
<input type="text" onkeydown="doit(event)" />
<script>
function doit(e) {
e.preventDefault();
}
</script>