---
title: Document.clear()
slug: Web/API/Document/clear
tags:
  - API
  - Deprecated
  - Document
  - HTML DOM
  - Method
  - Reference
browser-compat: api.Document.clear
---
{{APIRef("DOM")}}{{Deprecated_Header}}

The **`Document.clear()`** method does nothing, but doesn't raise any error.

## Syntax

```js
document.clear();
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
