I'm trying to retrieve the value of svg g element. Below is my code
<div id="chart">
<svg width="1386" height="186">
<g transform="translate(0,0)">
<g><circle class="node highlight" r="17.603478526018918" style="fill: #008000;" cx="521.2058097619438" cy="67.43023189750437"></circle>
</g>
<g><text class="label highlight" dx="22.603478526018918" dy=".35em" transform="translate(521.2058097619438,67.43023189750437)">CNN</text>
</g>
</g>
</svg>
</div>
I want to access the third 'g' element value i.e. 'CNN' in above case. How can I do it using jQuery.
Try this:
or this way:
even a better one: