title: JS: How to detect whether cursor is in textfield
body: <p>I want to use some letters ( keys ) as shortcut for some actions in javascript.  I want to check whether the cursor is focused on any textfield, form input, etc. so that the shortcut action will be canceled when user is typing something in a form or textfield.</p>
  
  <p>For example, i want an alert() to be executed when user presses 'A'. But if the user is typing  some text in a textarea like 'A website' then he will be pressing 'A', this time alert() should not be executed.</p>