SVGAElement

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 (en-US), e implementa propriedades de SVGURIReference (en-US) e de HTMLHyperlinkElementUtils.

SVGAElement.target Somente leitura

It corresponds to the target (en-US) attribute of the given element.

Metodos

Esta interface não tem metodos próprios, porém herda metodos da interface SVGGraphicsElement (en-US).

Exemplos

No exemplo abaixo, o target (en-US) 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

BCD tables only load in the browser

Veja também

  • SVG <a> element