The SVGMarkerElement interface provides access to the properties of <marker> elements, as well as methods to manipulate them. The <marker> element defines the graphics used for drawing marks on a shape.
The following properties and methods all return, or act on the attributes of the <marker> element represented by SVGMarkerElement.
Properties
This interface also inherits properties from its parent, SVGElement.
let marker = document.getElementById("arrow");
console.log(marker.markerWidth.baseVal.value);// 6
Updating the Orientation Angle
In the following example the value of the orient attribute is updated using setOrientToAngle() using an SVGAngle created using SVGElement.createSVGAngle().
let svg = document.getElementById("svg");let marker = document.getElementById("arrow");
console.log(marker.orientAngle.baseVal.value);// value in SVG above - 90let angle = svg.createSVGAngle();
angle.value ="110";
marker.setOrientToAngle(angle);
console.log(marker.orientAngle.baseVal.value);// new value - 110