I have this below code where i am trying to alert the date selected on click of an image. I am getting the alert but the issue is date format.
Below is alert i am getting. I need the alert in mm/dd/yyy.
And also why i am getting Thu Jan 01 1970 if i use todatestring() method.
Below is the javascript code