Tuesday, August 12, 2014

jQuery keyup event to table rows

How to bind keyup / keydown event to table?

Have you ever tried to bind a keyup/keydown event of jQuery? What you try it wont trigger. However it is possible with a minor change. By adding the tabindex=0 to the table if you bind to the table, or tabindex=0 to the tr when you bind to the table rows, jQuery will trigger the event and you can handle the eventbinding. So you will be able to use tab in table cells, tabbing on table rows or create own shortcuts.

Happy coding!

No comments:

Post a Comment