I have an svg path element. I want to access the height, width, x and y of the path element and after changing it want to set it back
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<path d="M150 0 L75 200 L225 200 Z" />
</svg>
How can i do this?
You can get the bounding box by calling
getBBox()so give the path an id attribute e.g. id="path1" and then in a script writebbox will have x, y, width and height attributes but you can’t change them directly.