-
Notifications
You must be signed in to change notification settings - Fork 22.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a7e014
commit 9cbd720
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: "SVGImageElement: href property" | ||
short-title: href | ||
slug: Web/API/SVGImageElement/href | ||
page-type: web-api-instance-property | ||
browser-compat: api.SVGImageElement.href | ||
--- | ||
|
||
{{APIRef("SVG")}} | ||
|
||
The **`href`** read-only property of the {{domxref("SVGImageElement")}} interface reflects the {{SVGAttr("href")}} or {{SVGAttr("xlink:href")}} {{deprecated_inline}} attribute of the given {{SVGElement("image")}} element. | ||
|
||
## Value | ||
|
||
An {{domxref("SVGAnimatedString")}} object. | ||
|
||
## Examples | ||
|
||
### Accessing the `href` property | ||
|
||
```js | ||
// Get the SVG image element | ||
const imageElement = document.querySelector("image"); | ||
|
||
// Access the href property | ||
const href = imageElement.href.baseVal; | ||
|
||
console.log(href); // Output: The href value | ||
``` | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} |