Load an animated SVG


I know I can load a change the background of class but how can I do this for an animated SVG, since I have this on several scenes I do not want to use a div id.

I would like to do this via a function as the SVG to be loaded can change depending on scene.

Any help is appreciated.

If it is an animated SVG, then instead of using a background-image property, my recommendation is to set the InnerHTML of an element to be the svg code. If that’s not what you were asking, can you clarify what you’re trying to do?