i have this function on js:
function get_days(){
var daysDiv = document.getElementById("days"); // here is the error
content = "";
for (i = 1; i <= numberOfDaysInMonth; i++){
content += "<li>" + i + "</li>";
}
daysDiv.innerHTML = content;
}
this is what I have in the HTML code:
<ul id="days"></ul>
the error is:
Uncaught TypeError: Cannot set properties of null (setting 'innerHTML').
I don't know why, but it thinks that the variable daysDiv is null.
` has been created?
– j08691 Feb 21 '22 at 21:22`
– j08691 Feb 21 '22 at 21:28