I am having form with couple of text boxes with focus in and focus out event.I am unable to fire click events on buttons because focus out event called once I lost writing from textboxes.How do fire click event to just after focus out.
$(document).on("focusout", ".fn-enlargeTextarea", function(event) {
var optionNumber = ($(this).attr('id').replace('1option','')).trim();
$('#1option'+optionNumber+'_counter').remove();
$(this).removeClass('textarea-height01').addClass('textarea-height02');
});
you could use event.relatedtarget
$(document).on("focusout", ".fn-enlargeTextarea", function(event) {
var optionNumber = ($(this).attr('id').replace('1option','')).trim();
$('#1option'+optionNumber+'_counter').remove();
$(this).removeClass('textarea-height01').addClass('textarea-height02');
var targetEvent = event.relatedTarget;
$(targetEvent).click();
});