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.
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
Especificação | Status | Comentário |
---|---|---|
Scalable Vector Graphics (SVG) 2 | Candidata a Recomendação | Replaced inheritance from SVGElement (en-US) by SVGGraphicsElement (en-US) and removed the interface implementations of SVGTests , SVGLangSpace , SVGExternalResourcesRequired , SVGStylable (en-US), and SVGTransformable by HTMLHyperlinkElementUtils |
Scalable Vector Graphics (SVG) 1.1 (Second Edition) | Recomendação | Definição inicial |
Compatibilidade com navegadores
BCD tables only load in the browser
Veja também
- SVG
<a>
element