Jump to content

Detect input/textarea active


wongadob
 Share

Recommended Posts

Is there any way in jQuery or Javascript that you can detect if the current focused/activce element is a textarea or input area. The reason for this is I need to use hotkeys but they will be standard keys (i.e. not control+key) so I need to do a key listener and then make it ignore the keypress and fall through if the user is inputting text. I can do this by testing the ID for the ID's of all mt inputs/textareas, but that seems to be a tad long winded. Be great if there was something like $(document).currentactiveID But can't seem to find anything As always any help much appreciated

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...