Skip to content

Commit

Permalink
New Pages: SVGImageElement (#37416)
Browse files Browse the repository at this point in the history
  • Loading branch information
yashrajbharti authored Jan 4, 2025
1 parent 9a7e014 commit 9cbd720
Showing 1 changed file with 37 additions and 0 deletions.
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}}

0 comments on commit 9cbd720

Please sign in to comment.