I have the following but it is not working. Does the jQuery event support the keyCode or do I need to get that someplace else?
$('#search-query').on('keyup',function(event){
if(event.keyCode!==38 or event.keyCode!==40){
search_autocomplete.call(this);
}
});
How would I tell jQuery to just ignore if it’s keyCode 38 or 40? Ultimately, I want to get this to like the search bar on http://www.linkedin.com/. Maybe just bootstrap it? http://twitter.github.com/bootstrap/javascript.html#typeahead
thx in advance
Use
||logical operator instead oforto join the condition in if statement.Live Demo
Change
To