This is purely a theoretical question so I’m not looking for alternative solutions.
Is there some way of getting the default handler to do something like this
var defaultHandler = $("#test").click;
$('#test').unbind('click');
$('#test').bind('click', defaultHandler);
You can access the
.data('events')object, which is used to store all event handler information:See this in action: http://www.jsfiddle.net/76GPF/
Remember, the
events objectis holdingArrays, so in the real world you should store the complete array information. I just stored the very first handler in this example.