I currently have this code:
<div class="form-group row">
<label for="example-date-input" class="col-2 col-form-label">Start Date</label>
<div class="col-4">
<input class="form-control" type="date" value="" id="start_date">
</div>
<label for="example-date-input" class="col-2 col-form-label">End Date</label>
<div class="col-4">
<input class="form-control" type="date" value="" id="end_date">
</div>
</div>
and This javascript:
var now = new Date();
var month = now.getMonth() + 1;
var year = now.getFullYear();
var day = now.getDate();
var start_date = month + "/1/" + year;
var end_date = month + "/" + day + "/" + year;
$("#start_date").val(start_date);
But for some reason the value of #start_date on page load does not change. It remains the place holder "mm/dd/yyyy"
Can anyone help explain why this will not work?
FYI: I am using Bootstrap 4.5.3 and Jquery 3.5.1.
You can see a JSFIDDLE of my attempt, with an excerpt of some of my code here: https://jsfiddle.net/69tn0q4f/1/