question on using textarea events

question on using textarea events

hello - 

i want to use an event when a textarea has changed, but only actually respond AFTER the user appears to be completed.

the best i have come up with is something like this:

  1. flag = null;   // define input response flag
  2. jQuery('input[name=textAreaField]').on('change input', ()  =>      {
  3.         flag = true;   // set input response flag
  4. })
  5. jQuery('input[name=textAreaField]').on('mouseleave', ()    =>      {
  6.       if  ( flag )       {   
  7.             flag = false;  // reset input response flag
  8.              respond......
  9.        }
  10. })
i can only assume that the jquery wizards will find much amusement in my silly solution and come up with something far better.

thank you all very much.