xxxxxxxxxx
//jQuery Keypress Listener on a textbox
$('input').keypress(function(event){
console.log(event.key)
//use keypress or event.key for other code here i,e.
if (event.key === 'a') {
console.log('move left function...');
}
});
//add key press eventlistener to entire body
$('body').keypress(function(event){
console.log(event.key)
});
//add Keypress eventListener to entire document
$(document).keypress(function(event){
console.log(event.key)
});
xxxxxxxxxx
$(document).ready(function() {
$("#dSuggest").keypress(function() {
var dInput = $('input:text[name=dSuggest]').val();
console.log(dInput);
$(".dDimension:contains('" + dInput + "')").css("display","block");
});
});