A while ago I posted a fun little word search puzzle – you can check that out at the link below.

https://elearning.adobe.com/2022/10/word-search-captivate-game-and-puzzle-series/

In this post – I wanted to take a moment to share with you the crafting of 100+ buttons and how just two lines of JavaScript allows every single button to behave the same way without modifying every action 100+ times.

Here is a short video demonstrating what I did.

Could I have selected the simple action for Go To Next State? Sure but I would still have to select all 100+ buttons and use the dropdown to pick which state to change. The JavaScript helps me avoid that need.

eLearningWordSearch

(901K)

All Comments
Sort by:  Most Recent
2022-11-29 23:38:14

Excellent game and explainer! You can also use “thisBox=event.target.id” (Vanilla JS) instead of using jQuery.

Like
(1)
2022-11-30 13:04:05

Thanks, Kim –

Something I appreciate about coding in general is that there are often so many ways to approach a problem. The doors are blown off the hinges..!

Like
2022-11-29 16:07:35

Hello Greg !…

I was waiting for this explanation !… So surprised it was so simple !… But as always, simple is best !…

I also like the way you talk and the way you explain everything… As you know I’m french, but it’s crystal clear for me !…

Thanks once more for sharing your lights !…

Happy Captivating !

😉

Like
(1)
2022-11-29 16:21:45

Glad to hear this was helpful for you!

Like