View Single Post

  #5 (permalink)  
Old 09-16-2003, 10:03 AM
Anonymous
Guest
 
Posts: n/a
Default Grouping SVG element and groups using JavaScript

To get DATA from objects you can use

Your_Node.attributes give list of attributes, with length you get number of attributes and with item(i) you get attribute and then name and value ....

with
Code:
<rect x="10" y="20" width="200" ...... />
node.attributes.item(0).name will be x and node.attributes.item(0).value will be 10 ...
but some viewer parsing string change order of attributes ....

To retrieve specific attribute you can use Your_Node.getAttributeNS(null,"x") to get value of x coordinate ....

For text content is firstChild.data for text node

Michel,
Reply With Quote