This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
The SVGAElement interface provides access to the properties of <a> element, as well as methods to manipulate them.
This interface also implements the following interfaces: SVGElement, SVGURIReference, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGStylable, SVGTransformable.
Properties
The interface provides the following properties:
SVGAElement.targetRead only- It corresponds to attribute
targeton the given<a>element.
Methods
The SVGAElement interface does not implement any specific methods.
Example
In the example below, the target attribute of <a> element is set to _blank and when the link is clicked, it alerts to notify whether the if condition is met or not.
var linkRef = document.querySelector('a');
linkRef.target ='_self';
linkRef.onclick = function(){
if (linkRef.target == '_blank') {
alert("BLANK !");
linkRef.target = '_self';
}
else
alert("SORRY! not _blank");
}
Specifications
| Specification | Status | Comment |
| Scalable Vector Graphics (SVG) 1.1 (Second Edition) The definition of 'SVGAltGlyphElement' in that specification. |
Recommendation |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | 9.0 | (Yes) | (Yes) |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | ? | (Yes) | ? | (Yes) | (Yes) |
See also
- SVG
<a>Element