Reputation: 2846
I'm dynamically inserting a <title>
into my group in an SVG, however its effect is not working. The element gets added at the proper location and everything, yet my group doesn't get a tooltip. The same element inserted by hand into the SVG works. How come my dynamically-inserted one isn't?
function setuptooltip() {
var shadowlegs = document.getElementById('shadow-legs');
var title = document.createElement('title');
var titletext = document.createTextNode("Hi there and greetings!");
title.appendChild(titletext);
// get the first child of shadowlegs, so we can insert before it
var firchild = shadowlegs.firstChild;
// insert before the first child
shadowlegs.insertBefore(title, firchild);
}
Here's the code: http://jsfiddle.net/bYjva/
Upvotes: 3
Views: 515