There is a description in the .on() jquery document:
The focus and blur events are set by the W3C so as not to bubble, but jQuery defines events with multiple focusin and focusout that bubble. When focus and blur are used to attach delegated event handlers, jQuery matches the names and passes them as focusin and focusout respectively. For consistency and clarity, use the bubble event type names.
Hope this would be helpful.
And you can try this code:
var default_input_value = null; jQuery('body').on('focusin focusout', 'input[type="text"]', function(event){ if(event.type === 'focusin'){ default_input_value = jQuery(this).val(); jQuery(this).val(''); }else if(event.type === 'focusout'){ if(jQuery(this).val().length === 0) jQuery(this).val(default_input_value); } });
source share