JSFiddle - React, Tailwind, and code Playground

by Ersin Bilgin

HTML

<form id="search" class="search"><input class="searchTerm" placeholder="Filter Books..."><input class="searchButton" type="submit"></form>

 <div id="status"></div>

JavaScript

$('.searchTerm').keydown(function (e) {

    $("#status").text("");


if (e.ctrlKey) {
    if (e.keyCode == 65 || e.keyCode == 97) { // 'A' or 'a'
console.log("controll pressed");
        alert("test");
      e.preventDefault(); 
 return false;
    }
  }

    $("#status").text("This should not work if cntrl+a is pressed");

});