Solution: Build a Live Counter or Scoreboard
Creates a simple counter that increases or decreases when buttons are clicked.
Explanation:
scorestarts at 0 and is shown inside the element with ID"score".When the “plus” button is clicked, the score increases by 1, updates on the screen, and turns green.
When the “minus” button is clicked, the score decreases by 1, updates on the screen, and turns red.
Solution: Build a Live Counter or Scoreboard
Creates a simple counter that increases or decreases when buttons are clicked.
Explanation:
scorestarts at 0 and is shown inside the element with ID"score".When the “plus” button is clicked, the score increases by 1, updates on the screen, and turns green.
When the “minus” button is clicked, the score decreases by 1, updates on the screen, and turns red.