I am trying to make a game similar to cookie clicker. This is part of my code:
Here's a solution giving your number a random new color on every click. I've changed the html from inline javascript to using an eventListener, which is what you want to use in real life
var clicks = 0;
document.getElementById("push").addEventListener("click", updateClickCount);
function updateClickCount() {
clicks++;
var el = document.getElementById("clickCount");
el.innerHTML = clicks;
el.style.color = '#'+Math.floor(Math.random()*16777215).toString(16);
}
Attribution: random color creation by Paul Irish