I have an input of type="date". I want to be able to add 10 extra days to it but I do not know how to do that.
I am able to display the current day by using the following:
$('#duedate').val((new Date().toJSON().slice(0,10)));
But how to add 10 days?
This will work for you:
var date = new Date();
date.setDate(date.getDate() + 10);
$('#duedate').val(date.toJSON().slice(0,10));
Demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With