I have loaded an SVG document via an object block and I am wanting to add a title tag programmatically to each group, but I am stuck. The SVG is loaded as follows:
<object data="International_Telecommunication_Union_region.svg" type="image/svg+xml" id="worldMap">
</object>
I then try to get one of the group elements, as follows (using JQuery 1.11.2):
$('g .landxx .BR')
but this returns an empty list. Yet if I do the following I get the element displayed in Chrome's console:
console.log($('g .landxx .BR'))
Can anyone suggest the right way to add a child element, to an SVG loaded via the object tag. I am would rather have the convenience of JQuery, but if this is not an option here, I am interested in hearing about alternatives.
BTW I did look at Raphael, but this seems to only allow manipulation of SVG objects created via Raphael, so not a viable option in this case.