how to call variable or property inside an object in javascript or jquery -
i getting dates(start , end dates) dynamically servers in json format, need implement in bootstrap date picker, not working here code note: implementing using variables names
// var start = obj1.start; // var end = obj1.end; var start = 01/02/1906; var end = 01/02/1998; $('#datepicker').datepicker({ autoclose: true, startdate: 'start', enddate: 'end', });
the quotes '
or "
around variables make them strings, not variable reverence. remove them quotes.
but on other hand, have add quotes on variable declaration, because these strings.
// add quotes here var start = '01/02/1906'; var end = '01/02/1998'; $('#datepicker').datepicker({ autoclose: true, // , remove quotes here startdate: start, enddate: end, });
Comments
Post a Comment