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

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -