How to use .contentDocument in a .hover variable path?
问题 I have an SVG loading like this: <object id="svg-object" type="image/svg+xml" width="1400px" height="900px" data="media/1.svg?"></object> I then have a function that works calling out one element in this svg and apply a style to it just fine. Here is the onload event that is working for getting me the element properly: window.onload=function() { var svgObject = document.getElementById('svg-object').contentDocument; var element = svgObject.getElementById('sprite1'); }; But how do I set a