marker element | SVGMarkerElement object
Defines shapes that can be attached to the middles or ends of line segments in path, line, polyline, and polygon elements.
![]() ![]() |
DOM Information
Inheritance Hierarchy
Members
The SVGMarkerElement object has these types of members:
Events
The SVGMarkerElement object has these events.
| Event | Description |
|---|---|
| onload |
Occurs when the browser has fully parsed the element and all of its descendants. |
Methods
The SVGMarkerElement object has these methods.
| Method | Description |
|---|---|
| setOrientToAngle |
Sets the value of the orientAngle attribute to the specified angle. |
| setOrientToAuto |
Sets the value of the svgMarkerOrient attribute to |
Properties
The SVGMarkerElement object has these properties.
| Property | Description |
|---|---|
|
Gets the names of the classes that are assigned to this object. | |
|
Sets or retrieves a reference to the SVG graphical object that will be used as the clipping path. | |
|
Gets a value that indicates whether referenced resources that are not in the current document are required to correctly render a given element. | |
|
Determines if an element can acquire keyboard focus (that is, receive keyboard events) and be a target for field-to-field navigation actions (such as when a user presses the Tab key). | |
|
Gets the height attribute of the marker element. | |
|
Gets or sets the coordinate system for the markerWidth and markerHeight attributes and for the contents of the marker element. | |
|
Gets the width attribute of the marker element. | |
|
Sets or retrieves a value that indicates a SVG mask. | |
|
Gets the angle of orientation of the marker element. | |
|
Gets the orientation type for a marker element. | |
|
Gets the nearest ancestor svg element. | |
|
Gets an XML value that indicates whether to force uniform graphic scaling. | |
|
Gets the refX attribute on the marker element. | |
|
Gets the refY attribute on the marker element. | |
|
Gets a style object. | |
|
Gets a value that indicates how a graphic scales to fit a container element. | |
|
Gets the element that established the current viewport. | |
|
Gets or sets the | |
|
Gets or sets a value that specifies the language that is used in the contents and attribute values of an element. | |
|
Gets or sets a value that indicates whether white space is preserved in character data. |
Standards information
Remarks
Examples
In the following code example, square markers are added to each end of a path. Copy this sample to a text file and save it with the .html file extension. Run it in Internet Explorer 9 to see the path with two markers on the screen.
The path with markers will look like this:
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<!-- Inline SVG -->
<svg width="400" height="400">
<!-- Definition of marker -->
<defs>
<marker id="knob"
viewBox="0 0 10 10" refX="0" refY="5"
markerUnits="strokeWidth"
markerWidth="4" markerHeight="3"
orient="auto">
<path d="M 0 0 L 10 5 L 0 10 z" />
</marker>
</defs>
<!-- Path that will have knobs at both ends -->
<path d="M 50,100 Q 150,50 250,100" stroke="hotpink"
stroke-width="10" fill="white"
marker-start="url(#knob)"
marker-end="url(#knob)" />
</svg>
</body>
</html>
See also

