kranthi kumar kranthi kumar - 1 year ago 69
jQuery Question

get content of <g> in SVG using javascript/jQuery

I have a bar graph developed in plotly and emded in a web app using iframe.
on mouse hover there is some content showing on the graph.
I dig down to see that the content is appending in

<g class="hoverover">
Is there any way I can get the content if the
is active using javascript/jQuery.

Answer Source


var i = document.getElementsByTagName("iframe")[0],
g = i.contentDocument.getElementByTagName("g")[0];



var i = $("iframe"),
$document = $(i[0].contentDocument);