How to make this countdown start on click?
https://code.sololearn.com/Wt8qVWz6waxp/?ref=app And I need it to work without changing background-color and other css I may add later.
\n\n... work fine :)\n\nAnd some smart JS library/framework trying to avoid overwriting of user custom global variables could raise exception if you use id name they expect to be available, such as p5.js and the global name \"log\":\n\nhttps://www.sololearn.com/Discuss/1610434/?ref=app","upvoteCount":2},{"@type":"Answer","text":"Oh sorry, don't call decrease_count() at onclick event. Make another function, say start() containing everything from lines 4-11 of your JS. And call this function on click.\n\nDoes that make sense?\n\nEdit: visph's method should work too.","upvoteCount":1},{"@type":"Answer","text":"Accessory, the clearInterval() is not required, as the page is reinitialized by the document.write() occurring after the page is fully loaded ^^\n(but it's cleaner practice, and should be here if the method to remove the button is changed)","upvoteCount":1},{"@type":"Answer","text":"💧Alex Tusinean🔥\nYes, indeed! Great job!","upvoteCount":0},{"@type":"Answer","text":"visph Haha, good idea to avoid ads 👍","upvoteCount":0}]} }
https://code.sololearn.com/Wt8qVWz6waxp/?ref=app And I need it to work without changing background-color and other css I may add later.