You can use the jQuery event object to get event information. event.type will tell you which event was triggered.
$('#textBox').bind('blur keyup', function(e){ if( e.type === 'blur' || (e.type === 'keyup' && e.which === 13) ){
You can also just check event.which , which will be undefined when this event is blur .
$('#textBox').bind('blur keyup', function(e){ if( typeof e.which === 'undefined' || e.which === 13 ){
source share