So here is my code and I want to add 1 to total every second`
var doughnut = 0;
function myFunction(){
document.getElementById("total").innerHTML = " total: " + setInterval(doughnut +1, 1000) ;
}
Can you explain me how setInterval() works and where to put it?