KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How do you copy an event handler from one element to another? For example: $('#firstEl') .click(function() { alert("Handled!"); }) ; // here's where the magic happens $('#secondEl').click = $('#firstEl').click; // ???? Note that the second element is being processed at a different time to when the first element is getting its handler, meaning that this: $('#firstEl, #secondEl').click(function() { ... }); ...won't work.
Tags (comma-separated)
Save Edits
Cancel