it looks like you can benefit from exploring the current status of web development and how this kind of problems are approached (both with frameworks or vanilla js solutions)

generally speaking you can store stuff in instance.data (even references to elements created in initialize or somewhere else) and then inside the update function decide what to do based on the properties you get and the data you stored

2 Likes