0
How to code a counter in html css
Html css
2 Answers
+ 2
From css you can do it like this:
https://code.sololearn.com/W6UiPBk24vK0/?ref=app
+ 1
You can't as far as I understand
You can use js
In html
<div id="counter"></div>
In js
window.onload=function(){
document.getElementById("counter").addEventListener("click",function(){
setInterval(counting,10);
});
var i=0;
function counting(){
document.getElementById("counter").innerHTML=i;
i++;
}
}
Now if you click on div element ,counter will start,if this is not what you wanted let me know!