Datepicker help

im new into js and i choose a code from internet and he doenst work well i guest
here the code

he only get the date from the actual month, and i want the any date from any year.
I see the console.log and there shows up, but only there.

can anyone help me…

im brazilian, sorry for the bad english, i need practices(without google translate)


When you are clicking the change month button or change year button then the ‘e’ which you are using to change the text inside your box is changing. Where as if you are not changing to new page then the event’s target remains the same.

Now the solution to the problem is to do

document.getElementById('d').value = selectedDate.toString();