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 -

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

Fatal error: Call to undefined function menu_execute_active_handler() in drupal 7.9 -