I want to import a SVG file using JavaScript and animate the graphic with CSS. I'm able to import the file but
cursor: pointer
doesn't work and I'm not able to access the SVG graphics attributes like fill or totalPathLenght. Where is the problem and how can I solve it?
- I tried importing the SVG like this:
const myGraphic = document.createElement("object");
myGraphic.data = "mySVG.svg";
document.body.appendChild(myGraphic);
- I also tried the same thing using iframe and embed