<div class="day">
  <div class="dayimg"></div>
</div>
<div class="day">
  <div class="dayimg"></div>
</div>
<div class="day">
  <div class="dayimg"></div>
</div>
<div class="day">
  <div class="dayimg"></div>
</div>
<div class="day">
  <div class="dayimg"></div>
</div>
const days = document.querySelectorAll('.day')

days.forEach((el, i) => {
  el.querySelector('.dayimg').textContent = i
})

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.