Web Interaction:

Reusable Components

We love spinning tacos so much that it’s now time to spin some burritos and pizza as well. By using hard-coded identifiers for button selectors and elements, we’ve painted ourselves into a corner where we must duplicate code if we are to add these new buttons. In this lesson, we transform our existing code to allow for our spin button functionality to be attached to any number of buttons using an iterator.

Learn More

  1. Lesson Source Code
Lesson 5 of 34