[svg-developers] Finding a nodes Id from Event

2005-11-11 Thread brunertodd
Apologies in advance for a stupid question that so far has resisted googling. I wish to know the Id value for a node that has been clicked. for example: g id=mybox onclick=printData(evt) polygon points=4,0 0,0 0,4 4,0 / g where the javascript section would look like elementdata[mybox] = Long

Re: [svg-developers] Finding a nodes Id from Event

2005-11-11 Thread Andre M. Winter - Carto.net
alert(elementdata[evt.target.getAttributeNS(null,'id')]); andré brunertodd wrote: Apologies in advance for a stupid question that so far has resisted googling. I wish to know the Id value for a node that has been clicked. for example: g id=mybox onclick=printData(evt) polygon

Re: [svg-developers] Finding a nodes Id from Event

2005-11-11 Thread david dailey
I think andré is correct. But when the event handler is a group, one might expect the group id to be returned. Instead (at least in dragging things around) I had to pass the group id as a parameter. In http://srufaculty.sru.edu/david.dailey/svg/drag4.svg (which works in either IE/ASV3 or