How do you copy an event handler from one element to another? For example:
$(\'#firstEl\') .click(function() { alert(\"Handled!\");
Is this what you are looking for?
var clickHandler = function() { alert("Handled!"); } $('#firstEl').click(clickHandler); $('#secondEl').click(clickHandler);