Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Pages: SVGImageElement #37416

Merged
merged 1 commit into from
Jan 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions files/en-us/web/api/svgimageelement/href/index.md
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}}
Loading