Site Logo

Week 5

Event Handlers and State

Event Handlers

These examples trigger alerts from function declarations. The second one uses an anonymous function with the function parameter.

Events with page data

Try rendering data from js to the DOM. Then try to manipulate it.

Changing information in the DOM needs something other than just declaring a variable as a let. we need useState

Counter Value: 0

Age Value: 28