Javascript Counter help

Dear all

Can anybody tell me why we have to place “value.textContent = count;” at the end of code block in the codepen

thanks alot

This is our element in html.

<span id="value">0</span>

Here we select it.

const value = document.querySelector("#value");

And finally inside event listener, after we make all calculations we update it with new value :wink:

value.textContent = count;

Dear sir

Copy that

Thanks alot