jquery - How can I pass a variable into a Date picker onSelect function -


basically accomplish having variable value inside onselect function. value set in dom ready function. need variable execute function called checkdates everytime there change in date picker.

jquery(function(){     var myvar = 'xzy'; });   $("#periodstartdate").datepicker({               onselect: function(datetext) {               console.log(myvar);     checkdates(this.value, $('#effectivestartdate').val(), myvar);           } }); 

var myvar; jquery(function(){            myvar = 'xzy';     });   $("#periodstartdate").datepicker({                     onselect: function(datetext) {                       console.log(myvar);             checkdates(this.value,$('#effectivestartdate').val(),myvar);                 }     }); 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -