(using http://code.google.com/p/svgweb/)
window.onsvgload = function() {
function onEnter(e) {
var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
alert(targ.hasAttributeNS(null, 'id')); //displays false
alert(targ.getAttributeNS(null, 'id')); //displays a blank dialog
alert(targ.id); //displays a blank dialog
}
/* Seldom_Seen is a group element in the SVG - <g id="Seldom_Seen">... */
document.getElementById('Seldom_Seen').addEventListener("mouseover", onEnter, false); //alert is blank
document.getElementById('normal_dom_element').addEventListener("mouseover", onEnter, false); //alert displays id as expected
}
The event listening works for SVG elements. I just can't seem to get the id. I can get other object properties like the x,y values. Anyway to get the ID of the targeted element?