I need to bind the 'enter' key on the keyboard to a specific javascript method, but ONLY when a certain text field is in focus.
<input id="post" type="text" style="width:400px;"/>
How would I do this?
I know you can do it with forms and stuff that have a submit action, but can I just bind the 'enter' key to a specific function when this above input
field is in focus?