0
I need to take the amount corresponding to the year of one <input type="date">
and subtract from the current date to display a user’s age (javascript). However, my result always gives "Nan". How do I fix it? And how do I get the JS itself to pick up the date (like, for example, the date("Y")
of PHP)?
var data = parseInt($('input[id=nasc]').val());
var ano = 2017;
var idade = ano - data;
localStorage.setItem("diaNasc", idade);
The solution worked out?
– novic
Know that the input date is specific to Google Crone, other browsers may not work well with it!
– Marconi