When using jQuery to hookup an event handler, is there any difference between using the click method
$().click(fn)
versus using the bind me
+1 for Matthew's answer, but I thought I should mention that you can also bind more than one event handler in one go using bind
$('#myDiv').bind('mouseover focus', function() {
$(this).addClass('focus')
});
which is the much cleaner equivalent to:
var myFunc = function() {
$(this).addClass('focus');
};
$('#myDiv')
.mouseover(myFunc)
.focus(myFunc)
;