---
title: DOMRect()
slug: Web/API/DOMRect/DOMRect
tags:
  - API
  - Constructor
  - DOM Reference
  - DOMRect
  - Geometry
  - Reference
browser-compat: api.DOMRect.DOMRect
---
{{APIRef("Geometry Interfaces")}}

The **`DOMRect()`** constructor creates a new {{domxref("DOMRect")}} object.

## Syntax

```js
new DOMRect(x, y, width, height);
```

### Parameters

- `x`
  - : The `x` coordinate of the `DOMRect`'s origin.
- `y`
  - : The `y` coordinate of the `DOMRect`'s origin.
- `width`
  - : The width of the `DOMRect`.
- `height`
  - : The height of the `DOMRect`.

### Return value

A new {{domxref("DOMRect")}} object.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("DOMPoint")}}
- {{domxref("DOMRect")}}
- {{domxref("DOMRect.fromRect()")}}
