Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. SVGAElement

SVGAElement

Baseline Widely available *

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.

TheSVGAElement interface provides access to the properties of an<a> element, as well as methods to manipulate them.

EventTarget Node Element SVGElement SVGGraphicsElement SVGAElement

Instance properties

This interface also inherits properties from its parent,SVGGraphicsElement.

SVGAElement.download

A string indicating that the linked resource is intended to be downloaded rather than displayed in the browser.

SVGAElement.hash

A string representing the fragment identifier, including the leading hash mark (#), if any, in the referenced URL.

SVGAElement.host

A string representing the hostname and port (if it's not the default port) in the referenced URL.

SVGAElement.hostname

A string representing the hostname in the referenced URL.

SVGAElement.hrefRead only

AnSVGAnimatedString that reflects thehref orxlink:hrefDeprecated attribute.

SVGAElement.hreflang

A string indicating the language of the linked resource.

SVGAElement.originRead only

Returns a string containing the origin of the URL — that is, its scheme, its domain and its port.

SVGAElement.pathname

A string containing an initial/ followed by the path of the URL, not including the query string or fragment.

SVGAElement.password

A string containing the password specified before the domain name.

SVGAElement.ping

A string that reflects theping attribute, containing a space-separated list of URLs to which, when the hyperlink is followed,POST requests with the bodyPING will be sent by the browser (in the background). Typically used for tracking.

SVGAElement.port

A string representing the port component, if any, of the referenced URL.

SVGAElement.protocol

A string representing the protocol component, including trailing colon (:), of the referenced URL.

SVGAElement.referrerPolicy

A string specifying whichreferrer to send when fetching theURL.

SVGAElement.rel

A string reflecting therel SVG attribute, specifying the relationship of the link's target.

SVGAElement.relList

ADOMTokenList reflecting therel SVG attribute, as a list of tokens.

SVGAElement.search

A string representing the URL's query string, if any, including the leading question mark (?).

SVGAElement.targetRead only

It corresponds to thetarget attribute of the given element.

SVGAElement.textDeprecated

A string that is a synonym for theNode.textContent property.

SVGAElement.type

A string that reflects thetype attribute, indicating the MIME type of the linked resource.

SVGAElement.username

A string containing the username specified before the domain name.

Instance methods

This interface has no methods but inherits methods from its parent,SVGGraphicsElement.

Example

In the example below, thetarget 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.

js
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");  }};

Specifications

Specification
Scalable Vector Graphics (SVG) 2
# InterfaceSVGAElement

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp