Learning how to hook event handlers in jquery