var img = document.createElement('object');
img.data = 'texture.svg';
img.type = 'image/svg+xml';
img.onload = function () {
console.log('cont: '+this.contentDocument.getElementById('K3').id);
this.contentDocument.getElementById('K3').style.fillColor = 'yellow';
};
I would like to load svg file which is texture for Three.js mesh.
Then I want to access element inside SCG with id K3 and change its fillColor to another.
I tried with img but here someone advice to use <object>
In my example onload method is not executed.