<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [isElementEqualOrContained](./x-components.iselementequalorcontained.md)

## isElementEqualOrContained() function

Returns true if the two elements are the same, or if `b` is a child of `a`<!-- -->.

**Signature:**

```typescript
export declare function isElementEqualOrContained(a: Element, b: Element): boolean;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

a


</td><td>

Element


</td><td>

The element to check if it is equal to `b` or if it contains `b`<!-- -->.


</td></tr>
<tr><td>

b


</td><td>

Element


</td><td>

The element to check if it is equal to `a` or contained inside it.


</td></tr>
</tbody></table>

**Returns:**

boolean

True if `a` is equal to `b` or if it contains `b`<!-- -->.

