Skip to content

Instantly share code, notes, and snippets.

Created September 27, 2017 15:17
What would you like to do?
Trick to change svg fill color
document.addEventListener('DOMContentLoaded', function() {
* Refrence to object element that has svg as data attribute
const obj = document.querySelector('object');
const svg = obj.contentDocument.querySelector("svg"); = "red" // change fill color to red
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment