0
I stored user's input in theDate variable but when putting at as argument in Date its not working. Is it because of its scope?
4 Answers
+ 1
Yes, because theDate has a function level scope.
+ 1
var theDate = "";
$(document).ready(function(){
// Get value on button click and show alert
$("#myBtn").click(function(){
var dd = $('#date').val();
var mm=$('#month').val();
var yy=$('#year').val();
var h=$('#hours').val();
var m=$('#minutes').val();
var s=$('#seconds').val();
theDate+=dd+mm+yy+" "+h+":"+m+":"+s;
});
});
var countDownDate = new Date(theDate).getTime();
0
How do I solve it?
0
Not working Avinesh