Having previously used jQuery date picker, I have now converted some of the date fields in forms on my website to the HTML5 date picker.
On the documentation, it says Sa
Taken from http://www.javascriptkit.com/javatutors/createelementcheck2.shtml
With jQuery and jQuery UI you can create a crossbrowser datepicker that only pops up when the browser doesn't support it natively. If you already have jQuery in your project, simply do:
var dateClass='.datechk';
$(document).ready(function ()
{
if (document.querySelector(dateClass).type !== 'date')
{
var oCSS = document.createElement('link');
oCSS.type='text/css'; oCSS.rel='stylesheet';
oCSS.href='//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/base/jquery-ui.css';
oCSS.onload=function()
{
var oJS = document.createElement('script');
oJS.type='text/javascript';
oJS.src='//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js';
oJS.onload=function()
{
$(dateClass).datepicker();
}
document.body.appendChild(oJS);
}
document.body.appendChild(oCSS);
}
});