Trying to find a way to validate if an input date chosen by the user, is older than the current date - 10 days. However, I'm stuck on this bit of code.
var date = document.getElementById("deliveryDate").value;
var varDate = new Date(date);
var today = new Date();
if(varDate < today.setDate(today.getDate() - 10)) {
alert("works!");
}
new Date()
includes the current time. I don't see where you've taken those factors into account.