I was trying to make dynamic cards with a script tag in the cards markup, but whenever I pressed the edit card button, the JS would run correctly once and the second I edit anything it would refresh and completely ignore the script.
I was wondering if there was a way to make it so the JS updates when I edit it rather than closing and reloading every time; or if I am just doing something completely wrong.