A friend recently asked me for some help with jQuery. He wanted to know how to store data on html elements from the JSON payload he was receiving. His initial approaches were much like some of my own early approaches, storing data on elements using data
attributes, and then updating those accordingly.
I've since come to learn that these are considered bad practices, and for good enough reasons. Sure, it can work, but it will be slow, and difficult to implement, and if your UI gets very complicated, you'll find yourself juggling multiple sources of truth in your application.
There are several approaches available to the modern web app developer, and I'm sorry I don't believe I'm a grand enough authority to choose a specific one for a project that isn't mine, but I am aware of enough different approaches I think I can get you oriented with what to look for in a good solution.