Possible Duplicate:
Getting the ID of the element that fired an event using jQuery
How do we find out what triggered an event?
I want to find out if a search input was triggered using the enter key or by clicking on a button.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume your binding to the search input using jQuery handlers as such. So just pass the event type along. For more information, pass the entire event object along: