Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
jQuery

Keyboard Events in jQuery

Listen for keydown, keyup, and keypress on inputs or document.

Keyboard Events in jQuery — a practical guide to jQuery keyboard events with clear examples you can reuse in real projects.

jQuery Tutorial Series (21/101). Prefer one article? Read the complete jQuery tutorial.

Short description

Prefer keydown/keyup; check event.key for modern code.

Keyboard

$('#search').on('keyup', function (e) {
  if (e.key === 'Enter') {
    runSearch($(this).val());
  }
});

Leave a reply

Your email address will not be published. Required fields are marked *