javascript - Accessing SVG element attribute from <use> element through external file -


i have svg line defined in line.svg file so:

<line id="vertical_line" x1="357.5" y1="153" x2="357.5" y2="80"/> 

i referencing "vertical_line" in javascript , adding svg line dom.

var verticalline = document.createelementns('http://www.w3.org/2000/svg', 'use'); verticalline.setattributens('http://www.w3.org/1999/xlink', 'xlink:href','./images/line.svg#vertical_line'); 

i want able manipulate verticalline's "y1" attribute value. cannot access attribute via verticalline object.

what method can use access svg attribute of original svg element when creating element through javascript external file?


Comments

Popular posts from this blog

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -