I have separate json containing SVG path Ids. Is there a way to get SVG path 'd' attribute using path id? Or is there a way to fill SVG path only using path Id?
You can get the path element by calling document.getElementById and from there you can get/set attributes...
var d = document.getElementById("<path id>").getAttribute("d");
document.getElementById("<path id>").setAttribute("fill", "red");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With