How can you “extend” or add more functionality to a .keydown()?
Lets say you already got this:
input.keydown(function(){
alert('key pressed');
});
How can you then later on add one more alert()?
alert('extra functionality');
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.
just:
When an event reaches an element, all handlers bound to that event type for the element are fired. If there are multiple handlers registered, they will always execute in the order in which they were bound. After all handlers have executed, the event continues along the normal event propagation path.
http://api.jquery.com/bind/
if you need a possibility to unbind it later use:
http://api.jquery.com/unbind/