This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
The SVGAElement interface provides access to the properties of an <a> element, as well as methods to manipulate them.
This interface also inherits properties from its parent, SVGGraphicsElement.
SVGAElement.downloadSVGAElement.hashA string representing the fragment identifier, including the leading hash mark (#), if any, in the referenced URL.
SVGAElement.hostA string representing the hostname and port (if it's not the default port) in the referenced URL.
SVGAElement.hostnameA string representing the hostname in the referenced URL.
SVGAElement.href Read only
An SVGAnimatedString that reflects the href or xlink:href Deprecated attribute.
SVGAElement.hreflangA string that reflects the hreflang attribute, indicating the language of the linked resource.
SVGAElement.origin Read only
Returns a string containing the origin of the URL, that is its scheme, its domain and its port.
SVGAElement.pathnameA string containing an initial / followed by the path of the URL, not including the query string or fragment.
SVGAElement.passwordA string containing the password specified before the domain name.
SVGAElement.pingA string that reflects the ping attribute, containing a space-separated list of URLs to which, when the hyperlink is followed, POST requests with the body PING will be sent by the browser (in the background). Typically used for tracking.
SVGAElement.portA string representing the port component, if any, of the referenced URL.
SVGAElement.protocolA string representing the protocol component, including trailing colon (:), of the referenced URL.
SVGAElement.referrerPolicySVGAElement.relA string reflecting the rel SVG attribute, specifying the relationship of the link's target.
SVGAElement.relListA DOMTokenList reflecting the rel SVG attribute, as a list of tokens.
SVGAElement.searchA string representing the search element, including leading question mark (?), if any, of the referenced URL.
SVGAElement.target Read only
It corresponds to the target attribute of the given element.
SVGAElement.text Deprecated
A string that is a synonym for the Node.textContent property.
SVGAElement.typeA string that reflects the type attribute, indicating the MIME type of the linked resource.
SVGAElement.usernameA string containing the username specified before the domain name.
This interface has no methods but inherits methods from its parent, SVGGraphicsElement.
In the example below, the target attribute of the <a> element is set to _blank and when the link is clicked, it logs to notify whether the condition is met or not.
const linkRef = document.querySelector("a");
linkRef.target = "_self";
linkRef.onclick = () => {
if (linkRef.target === "_blank") {
console.log("BLANK!");
linkRef.target = "_self";
} else {
console.log("SORRY! not _blank");
}
};
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2> # InterfaceSVGAElement> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
SVGAElement |
1 | 12 | 3 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 3 | 1 |
download |
No | No | 20 | No | No | No | 20 | No | No | No | No | No |
href |
1 | 12 | 4 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 3 | 1 |
hreflang |
No | No | 61 | No | No | No | 61 | No | No | No | No | No |
ping |
No | No | 61This property is exposed but has no effect if thebrowser.send_pings preference is not set to true. See bug 951104. |
No | No | No | 61This property is exposed but has no effect if thebrowser.send_pings preference is not set to true. See bug 951104. |
No | No | No | No | No |
referrerPolicy |
No | No | 61 | No | No | No | 61 | No | No | No | No | No |
rel |
136 | 136 | 61 | 121 | 14 | 136 | 61 | 90 | 14 | No | 136 | 14 |
relList |
136 | 136 | 61 | 121 | 14 | 136 | 61 | 90 | 14 | No | 136 | 14 |
target |
1 | 12 | 3 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 3 | 1 |
text |
No | No | 61–125 | No | No | No | 61–125 | No | No | No | No | No |
type |
No | No | 61 | No | No | No | 61 | No | No | No | No | No |
<a> element
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SVGAElement