✔️JavaScript: Why does my function execute before the button is clicked? [closed]

The removeLives function executes onload and not onClick. The goal is to subtract 1 life every time the button is clicked.

problems with local storage and onClick on page refresh

hello guys i am woking on this app where there are 3 states on a button first state, this is the default when the web page is openend for the first time Picture 1:- then when you click it, it changes …