From 3f9ac08599360bf28a4c0b0b55b3b4e040e3b2eb Mon Sep 17 00:00:00 2001 From: yashrajbharticybtekk Date: Sat, 23 Nov 2024 17:07:49 +0530 Subject: [PATCH 1/3] add: SVGAElement href property --- files/en-us/web/api/svgaelement/href/index.md | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 files/en-us/web/api/svgaelement/href/index.md diff --git a/files/en-us/web/api/svgaelement/href/index.md b/files/en-us/web/api/svgaelement/href/index.md new file mode 100644 index 000000000000000..f691183fa33c90d --- /dev/null +++ b/files/en-us/web/api/svgaelement/href/index.md @@ -0,0 +1,44 @@ +--- +title: "SVGAElement: href property" +short-title: href +slug: Web/API/SVGAElement/href +page-type: web-api-instance-property +browser-compat: api.SVGAElement.href +--- + +{{APIRef("SVG")}} + +The **`SVGAElement.href`** read-only property of the {{domxref("SVGAElement")}} returns an {{domxref("SVGAnimatedString")}} object reflecting the value of the href attribute, and, in certain cases, the {{SVGAttr("xlink:href")}} {{deprecated_inline}} attribute. It specifies the target URI associated with the link. + +This property enables access to the URI set for a link within an SVG document. + +## Value + +An {{domxref("SVGAnimatedString")}} indicating the value of the href attribute. Additionally, for elements defined to support it, it reflects the value of the {{SVGAttr("xlink:href")}} {{deprecated_inline}} attribute when the href attribute is not set. + +## Examples + +```js +// Select an SVG element +const svgLink = document.querySelector("a"); + +// Access the href property +console.log(svgLink.href.baseVal); // Logs the base URI +console.log(svgLink.href.animVal); // Logs the animated URI if applicable + +// Example: Reflecting xlink:href +const deprecatedLink = document.querySelector("a"); +console.log(deprecatedLink.href.baseVal); // Reflects 'xlink:href' if 'href' is not set +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{ SVGAttr("href") }} From ab0e0fc9de6c463c8f6fcb9ad7af498ff9f7e915 Mon Sep 17 00:00:00 2001 From: Yash Raj Bharti <43868318+yashrajbharti@users.noreply.github.com> Date: Mon, 25 Nov 2024 02:44:39 +0530 Subject: [PATCH 2/3] Update files/en-us/web/api/svgaelement/href/index.md Co-authored-by: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> --- files/en-us/web/api/svgaelement/href/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/svgaelement/href/index.md b/files/en-us/web/api/svgaelement/href/index.md index f691183fa33c90d..974d58b606e8d78 100644 --- a/files/en-us/web/api/svgaelement/href/index.md +++ b/files/en-us/web/api/svgaelement/href/index.md @@ -14,7 +14,7 @@ This property enables access to the URI set for a link within an SVG document. ## Value -An {{domxref("SVGAnimatedString")}} indicating the value of the href attribute. Additionally, for elements defined to support it, it reflects the value of the {{SVGAttr("xlink:href")}} {{deprecated_inline}} attribute when the href attribute is not set. +A {{domxref("SVGAnimatedString")}} indicating the value of the href attribute. Additionally, for elements defined to support it, it reflects the value of the {{SVGAttr("xlink:href")}} {{deprecated_inline}} attribute when the href attribute is not set. ## Examples From b6b589ebeae56596090e63394d9d5624ced93b45 Mon Sep 17 00:00:00 2001 From: Yash Raj Bharti <43868318+yashrajbharti@users.noreply.github.com> Date: Mon, 25 Nov 2024 02:44:47 +0530 Subject: [PATCH 3/3] Update files/en-us/web/api/svgaelement/href/index.md Co-authored-by: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> --- files/en-us/web/api/svgaelement/href/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/svgaelement/href/index.md b/files/en-us/web/api/svgaelement/href/index.md index 974d58b606e8d78..87c97baeaab2f43 100644 --- a/files/en-us/web/api/svgaelement/href/index.md +++ b/files/en-us/web/api/svgaelement/href/index.md @@ -8,7 +8,7 @@ browser-compat: api.SVGAElement.href {{APIRef("SVG")}} -The **`SVGAElement.href`** read-only property of the {{domxref("SVGAElement")}} returns an {{domxref("SVGAnimatedString")}} object reflecting the value of the href attribute, and, in certain cases, the {{SVGAttr("xlink:href")}} {{deprecated_inline}} attribute. It specifies the target URI associated with the link. +The **`href`** read-only property of the {{domxref("SVGAElement")}} returns an {{domxref("SVGAnimatedString")}} object reflecting the value of the href attribute, and, in certain cases, the {{SVGAttr("xlink:href")}} {{deprecated_inline}} attribute. It specifies the target URI associated with the link. This property enables access to the URI set for a link within an SVG document.