Q:

jQuery on keyup and ignoring specific events

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

A:

Use || logical operator instead of or to join the condition in if statement.
Live Demo
Change
 if(event.keyCode!==38 or event.keyCode!==40){

To
 if(event.keyCode!==38 || event.keyCode!==40){

