JavaScriptHTML + CSS + JavaScript
Draft saved locallyJavaScript · Spaces: 2
Live preview move your pointer inside
Make the + Button Work
Online shops keep a quantity in JavaScript state, then update the page when it changes. This is the same variable idea you used in Basic JS, now connected to the DOM.
01
Your mission
Make the + button increase the quantity by 1 and update the visible quantity.
- Increase
quantityby 1 insideaddOne(). - Set
quantityText.textContenttoQuantity:followed by the current quantity.
Check quantity Run project