jquery event handler- trigger function upon specific key and action

Posted by Gal on Stack Overflow See other posts from Stack Overflow or by Gal
Published on 2010-03-27T22:53:37Z Indexed on 2010/03/27 23:03 UTC
Read the original article Hit count: 216

Filed under:
|
|
|

Background story: when a user selects a portion of text in a text field with her mouse (mark it up manually), and subsequently hits "alt" key, a certain function would trigger.

My questions are:

  • How can I trigger a function when a user hits a key (in her keyboard)?
  • How can I preserve a portion of text selected, and use it as a parameter for that function?

I've tried looking up online but haven't found any good answers, but i'd greatly appreciate links as well.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about trigger