title: How do know target event in advance using jQuery
body: <p>I have a form having couple of  <code>textAreas</code> and buttons there is event <code>focusout</code> handled for all <code>textAreas</code>. I am facing the problem as soon as <code>click</code> event fire on buttons when user done typing in any of <code>textareas</code> and click on save buttons only <code>focusout</code> called on <code>textareas</code> , however click event on buttons didn't work. Here is my <code>focusout</code> on <code>textareas</code>:</p>
  <pre><code>$(document).on(&quot;focusout&quot;, &quot;.fn-enlargeTextarea&quot;, function() {
       // wants to capture cause event of focusout and fire after focusout.
       var optionNumber = ($(this).attr('id').replace('1option','')).trim();
       $('#1option'+optionNumber+'_counter').remove();
       $(this).removeClass('textarea-height01').addClass('textarea-height02');     
  });
  </code></pre>
  <p>I just came to know in advance that , how do know cause event of <code>focusout</code> on textareas so that I can fire target event as soon as <code>focusout</code> event consumed.</p>
  <p>Here are the buttons inside form:</p>
  <pre><code>&lt;form id=&quot;dataPost&quot;&gt;
     &lt;c:forEach items=&quot;${forumOptions}&quot; var=&quot;option&quot; varStatus=&quot;loop&quot;&gt;
                            &lt;div class=&quot;radio m-b-15&quot;&gt;
                                &lt;label class=&quot;primary-radio row width03&quot; for=&quot;option01-01&quot;&gt;
                                    &lt;span class=&quot;primary-radio-blue col-xs-1 text-right margin-top-1&quot;&gt;
                                     &lt;c:out value=&quot;${forumOptions[loop.index]}&quot;&gt;&lt;/c:out&gt;.&lt;/span&gt; 
                                    &lt;span class=&quot;col-xs-11&quot;&gt;
                                        &lt;textarea name=&quot;pollQuestionList[0].pollOptionList[${loop.index}].optionText&quot;  id=&quot;1option${loop.index+1}&quot; class=&quot;form-control fn-input-text fn-input-options textarea-height02&quot;  &gt;&lt;/textarea&gt;
                                    &lt;/span&gt;
                                &lt;/label&gt;
                            &lt;/div&gt;
                            &lt;/c:forEach&gt;
    &lt;button type=&quot;button&quot; data-toggle=&quot;modal&quot; data-target=&quot;#myModal&quot; class=&quot;btn btn-dark-black cus-btn btn-preview&quot; id=&quot;poll-save-and-preview&quot;&gt;Save &amp;amp; Preview&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;btn btn-dark-black cus-btn&quot; id=&quot;poll-save&quot;&gt; Save&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;btn btn-dark-black cus-btn&quot; id=&quot;poll-close&quot;&gt; Close&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;btn  btn-warning  btn-font cus-btn-pad lpopup&quot; id=&quot;poll-publish&quot;&gt; Post&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  <p><img src="https://i.stack.imgur.com/mRs27.png" alt="see here" /></p>