title: Pass a flag from one event to another in Jquery
body: <p>If I have a Text Input field in a form with id say "input_id". During loading the page I would populate the field with existing data</p>
  
  <p>While submitting the form using a button of id "form_submit", I want to determine if the field has been altered in any way. So that I would take particular action pertaining to the change.</p>
  
  <pre><code>In Jquery:
  
  $("#input_id").on("keyup",function(){
      //set a flag to indicate the field is altered
  })
  
  $("#form_submit").on("click",function(){
      //check flag to see if #input_id is changed
  }
  </code></pre>
  
  <p>So how do I set a flag in one event, and read it in another without using a global variable ?</p>
  
  <p>Thanks in advance</p>