1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Connect An Event To a Stimulus Controller Action

    javascriptJavaScript

    In this lesson, we'll explore what it takes to connect a user input event to a Stimulus controller method, using a Stimulus action. In doing so, we'll be able to filter down a collection of DOM elements, grouped by a Stimulus target, to show relevant filtered content to the user as they type.

    We'll also learn about some incredibly useful JavaScript features, including Array.from, String.includes, and a little known feature of classList.toggle. Once you get down to the actual Stimulus controller code, it's "just JavaScript"!