I am trying to make a little sample dropdown appear when a user enters a certain combination of letters in the form. I think I am having syntax/logic problems because I can't even get the alerts to work.
$(document).ready(function () {
$("#inputt").keypress(
function(event) {
if (event.which == melee || MELEE) {
alert("You typed MELEE");
} else if (event.which == knuckle || KNUCKLE) {
alert("You typed KNUCKLE");
} else {
alert("Neither!!!");
$('.knuckle').hide();
$('.melee').hide();
}
});
});
Here is the sample. https://jsfiddle.net/galnova/snp1hqr7/1/