In a php file i've a div with id
and data returned, see the code please:
<div id="dom-target" style="display: none;" data-stuff="2017, 8, 20, 0, 0"></div>
Okay, now i need pass data-stuff value into new Date call, (is a countdown), i try with a variable, but NaN
is displayed, for example
var ar = $('#dom-target').data('stuff');
Finally the JS code is:
if (jQuery().mbComingsoon) {
var ar = $('#dom-target').data('stuff');
jQuery('#myCounter').mbComingsoon({expiryDate: new Date(ar), speed: 500});
setTimeout(function () {
jQuery(window).resize();
}, 200);
}
Apparently i can't use new Date(ar)
to call data from div?
Thank you!