I have an SVG in which i want to add a particular styling to all circle having r="5"
<div class="svgchart">
<svg width="1190" height="390">
<circle class="bubble-plot-chart-circle" cx="400" cy="400" r="40" fill="blue"></circle>
<circle class="bubble-plot-chart-circle" cx="400" cy="400" r="5" fill="blue"></circle>
<circle class="bubble-plot-chart-circle " cx="400" cy="400" r="5" fill="blue"></circle>
</svg>
</div>
I have tried this but does not work
var allElements = document.getElementsByClassName("bubble-plot-chart-circle");
for(var i = 0; i < allElements.length; i++) {
var element = allElements[i];
if(element.getAttribute("r") === "5") {
// it takes the initial inline style which was applied at the time of crating the SVG
element.setAttribute("opacity", "0 !important");// does not work for SVG
element.addClass("test"); // does not work for SVG
}
}
can any one help me on this as i am new to SVG