An education consultancy focused on researching, designing, building, and testing cutting-edge curriculum, running bold experiments to innovate learning.
Cool explorations! Over the years, we've built these so many ways!!! It's crazy. You can even use a checkbox now - and skip the JavaScript completely - but on the subject of JavaScript: check out this approach
With this style of "event delegation" (having one listener and then doing different stuff depending on what is clicked) - you can really simplify the whole thing. What do you think?
An education consultancy focused on researching, designing, building, and testing cutting-edge curriculum, running bold experiments to innovate learning.
Cool explorations! Over the years, we've built these so many ways!!! It's crazy. You can even use a checkbox now - and skip the JavaScript completely - but on the subject of JavaScript: check out this approach
With this style of "event delegation" (having one listener and then doing different stuff depending on what is clicked) - you can really simplify the whole thing. What do you think?
Here's a more fleshed out example too. : )