I have 5 text areas on a page and I would like a specific event to occur on hitting the enter key on the first text area and a different event on enter key of the other text areas. Can you please suggest on how this can be acheived.
<TextArea></TextArea>
<TextArea></TextArea>
<TextArea></TextArea>
<TextArea></TextArea>
<TextArea></TextArea>
when hitting the enter on 1st Text Area, alert('Text Area 1 clicked');
when hitting the enter on the other 4 Text Area, alert ('Other Text Area's clicked');
Can this be acheived using jquery.
http://jsfiddle.net/26kN7/1/
in some versions of FFX pressing
<Tab>, e.which isn’t set (remains 0), but e.keyCode is (9).you can also shorten this to
the other thing note is I like adding the class here than finding the first textarea is cos this is more generic solution and could cater to any of the textareas.