title: How can I pass a variable into a Date picker onSelect function
body: <p>Basically what I would like to accomplish is having a variable value inside the onSelect function. This value will be set in the Dom ready function. I need this variable to execute a function called checkDates everytime there is a change in the date picker.</p>
  
  <pre><code>jQuery(function(){  
    var myVar = 'xzy';
  }); 
  
  $("#PeriodStartDate").datepicker({            
    onSelect: function(dateText) {          
      console.log(myVar);
      checkDates(this.value, $('#EffectiveStartDate').val(), myVar);        
    }
  });
  </code></pre>