Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Making the Page Respond (Summary)

You’ve finished Making the Page Respond, and Priya’s RSVP board is done.

It started with functions as values. You stored describeGame() as an arrow and passed a function without a call. Then you handed one to the browser. The script ran to its end, then the browser called your handler on every click. Each Check in button got its own listener.

Next, you found every Check in button and stepped up from one to its guest’s row. You stored ids in data attributes and marked arrivals with a class. The Elements panel showed each change live.

Last, the games became cards. You clicked Bring Azul, and its card turned pale blue. Then two votes put Catan ahead. The Quick games only button hid the games over 45 minutes, then brought them back, votes and all.

What You Can Do Now

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

00:00 You’ve finished Making the Page Respond, and Priya’s RSVP board is done.

00:06 You can now make a page react to clicks, find elements anywhere in it, and switch classes, attributes and data on them, checking each change in the Elements panel.

00:17 It started with functions as values. You stored describeGame as an arrow and passed a function without a call. Then you handed one to the browser. The script ran to its end, then the browser called your handler on every click.

00:32 Each Check in button got its own listener.

00:36 Next, you found every Check in button and stepped up from one to its guest’s row. You stored ids in data attributes and marked arrivals with a class. The Elements panel showed each change live.

00:50 Last, the games became cards. You clicked Bring Azul, and its card turned pale blue. Then two votes put Catan ahead. The Quick games only button hid the games over 45 minutes, then brought them back, votes and all.

01:07 Here’s what to keep with you. Hand the browser the function, not a call. Keep state that lasts between clicks outside the handler. Find elements with a CSS selector.

01:19 Use closest to step up to a button’s item. Data attributes come back as strings. Switch a class, and let the stylesheet decide the look. Then check each change in the Elements panel, which shows the live page.

01:35 Every button on the board has its own listener, and that works. The next course on this path picks up Priya’s page from there. To review writing functions and parameters, see Functions in JavaScript on RealJS.

01:49 The JavaScript Glossary explains any new terms. Enjoy game night. Thanks for watching!

Become a Member to join the conversation.