Explain Your Recipe Box

Sam’s recipe box works. Recipes go in through a form that refuses bad ones, / jumps to a filter that narrows the list as you type, and Delete asks before anything goes. Each add, delete, and filter change is announced, and you can operate the page with the keyboard alone.

The exercises’ tests checked what the page does after a set of keypresses. They couldn’t check whether you can explain why the form listens for submit or why the focus lands where it does after a delete.

Nor could they watch you test the page with the keyboard alone. When you know why each part works, Sam can ask for one more feature, and you can add it without breaking anything else.

In this session, you’ll walk the mentor through your code, predict what the form and the focus do, and test the page with the mouse untouched. Then you’ll make a change to the recipe box that the course hasn’t shown you. By the end, you’ll know which parts you can explain with confidence and which ones need another look.

Part of the session happens in your browser, so get set up first. Start Live Preview on recipes/index.html, and open index.html and main.js in your editor. If you wrote code only in an exercise, copy it into your own main.js now, so your page does everything Sam’s brief asks. Keep DevTools open on the Elements panel, because you’ll look at the Accessibility tab there.

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

Become a Member to join the conversation.