<input type="date" class="pate" data-date-inline-picker="true" />
I was trying to pick the selected date of the above date picker, but I could retrieve that.
console.log(document.querySelector(".pate"));
This renders this in the browser:
I also tried this:
console.log(document.querySelector('input[type="date"]').valueAsNumber);
But the above gives NAN
it has a value
property, that is an empty string until someone correctly enters a date in there.
1 Like
Thanks for replying, sir. But what should I do to get the value once the date is selected?
Any suggested reading or solution to this?
Once the date is selected and is valid (can troubleshoot using validity object property), you can use value
, or valueAsDate
, or valueAsNumber
to get what you need from it.
1 Like
I find that MDN is a reliable source. The following about dates should be worth investigating:
3 Likes
Here’s a date picker example that helps to show and expose different parts of the system.
1 Like
system
Closed
May 9, 2022, 2:19pm
8
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.