I have the following code:
<html><body>
<div id="1" style="display:none"></div>
<div id="2" style="display:none"></div>
<div id="3" style="display:none"></div>
<div id="4" style="display:none"></div>
<div id="5" style="display:none"></div>
</body></html>
<script>
var minutes_array = [];
for (var i = 0; i < 6; i++) {
minutes_array.push(i);
}
minutes_array.forEach(myFunction);
function myFunction(item, index) {
document.getElementById(item).style.display = 'flex';
}
</script>
I want to show all the five div's with this JavaScript code. But it isn't working. The div's don't show up. What am I doing wrong? Many thanks in advance.