---
title: "SVGSVGElement.GetElementById"
url: "https://reference.aspose.com/html/java/com.aspose.html.dom.svg/svgsvgelement/getelementbyid/"
product: "Aspose.HTML for Java API Reference"
description: "SVGSVGElement method. Searches this SVG document fragment i.e. the search is restricted to a subset of the document tree for an Element whose id is given by elementId. If an Element is found that Element is returned. If no such element exists returns null. Behavior is not defined if more than one element has this id"
---

## SVGSVGElement.GetElementById method

Searches this SVG document fragment (i.e., the search is restricted to a subset of the document tree) for an Element whose id is given by elementId. If an Element is found, that Element is returned. If no such element exists, returns null. Behavior is not defined if more than one element has this id.

```java
public Element GetElementById(String elementId)
```

| Parameter | Type | Description |
| --- | --- | --- |
| elementId | String | The unique id value for an element. |

### Return Value

The matching element.

### See Also

* class [Element](../../../com.aspose.html.dom/element/)
* class [SVGSVGElement](../)
* package [com.aspose.html.dom.svg](../../../com.aspose.html.dom.svg/)
* package [Aspose.HTML](../../../)
