---
title: DOMParser()
slug: Web/API/DOMParser/DOMParser
tags:
  - API
  - Constructor
  - DOM Parsing
  - Parsing
  - Reference
browser-compat: api.DOMParser.DOMParser
---
The **`DOMParser()`** constructor creates a new [`DOMParser`](/en-US/docs/Web/API/DOMParser) object.

## Syntax

```js
const parser = new DOMParser();
```

### Parameters

None.

### Return value

A new [`DOMParser`](/en-US/docs/Web/API/DOMParser) object. This object can be used to parse the text of a document using the `parseFromString()` method.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
