I'm aware both these examples do the same thing, but are their any hidden differences? Is one faster than the other? Is it just a preferance?
$('#div1').on('click', function() {
$('#div2').toggle();
});
$('#div1').click(function() {
$('#div2').toggle();
});