I want the escape key to remove/hide a dropdown when a class is being displayed as a block.
On entry to a page there is a dropdown that is not activated until you click on the selection. The code checks to see whether the dropdown class is set to display:block
. If so then clicking on the escape key triggers a response.
For now i just want an alert to show.
if ($('body').css('color') === '#353C3A') {
$('body', context).on('keyup', function(evt) {
if (evt.keyCode === 27) {
alert('This is just a test to see this message');
}
});
}
I am expecting to see the alert box once i click on the escape key but i do not. many thanks in advance