Targeted Text Update
Targeted Text Update
Changing an element's textContent replaces all text inside that element, including text from child elements. When only one piece of a component should change, select that child directly.
This matters for buttons, cards, and status rows that combine labels with icons, counts, or helper text.
Your task: Update only the button label from Add to Added. Keep the icon span and the button element in place.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Targeted Text Update
Changing an element's textContent replaces all text inside that element, including text from child elements. When only one piece of a component should change, select that child directly.
This matters for buttons, cards, and status rows that combine labels with icons, counts, or helper text.
Your task: Update only the button label from Add to Added. Keep the icon span and the button element in place.