Level 58
The error "TypeError: inputDate is null" is occurring because the element with id "inputDate" is not found in the HTML document. To fix this, add the element with id "inputDate" to the HTML document.
HTML:
<input type="text" name="inputDate" id="inputDate">
If you want to set the value of the input field to the selected date, you can use the value property instead of the textContent property.
JavaScript:
const inputDate = document.getElementById('inputDate');
inputDate.value = newDate;