SVGAElement

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

* Some parts of this feature may have varying levels of support.

O SVGAElement interface fornece acesso as propriedades do elemento <a>, bem como metodos para manipula-los.

Propriedades

Esta interface também herda propriedades de sua interface pai,SVGGraphicsElement, e implementa propriedades de SVGURIReference e de HTMLHyperlinkElementUtils.

SVGAElement.target Somente leitura

It corresponds to the target attribute of the given element.

Metodos

Esta interface não tem metodos próprios, porém herda metodos da interface SVGGraphicsElement.

Exemplos

No exemplo abaixo, o target atributo do elemento <a> recebe o valor _blank e quando o link for clicado, ele notifica se a condição é verdadeira ou falsa.

js
var linkRef = document.querySelector("a");
linkRef.target = "_self";

linkRef.onclick = function () {
  if (linkRef.target === "_blank") {
    console.log("BLANK!");
    linkRef.target = "_self";
  } else {
    console.log("SORRY! not _blank");
  }
};

Especificações

Specification
Scalable Vector Graphics (SVG) 2
# InterfaceSVGAElement

Compatibilidade com navegadores

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
SVGAElement
download
href
hreflang
ping
referrerPolicy
rel
relList
target
text
Deprecated
type

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Deprecated. Not for use in new websites.
See implementation notes.

Veja também

  • SVG <a> element