JS sends current time (hh:mm) and updates HTML page using .innerHTML.
I want to display time at two locations in same page so I duplicated the html
<div class="time"></div>
<div class="time"></div>
now using [0] and [1], I can call the same class twice.
document.getElementsByClassName("time")[0].innerHTML = hour+":"+minute+":"+second;
document.getElementsByClassName("time")[1].innerHTML = hour+":"+minute+":"+second;
Is there anyway I can call both by single line. Did a quick search but couln't find solution.