---
title: Document.defaultView
slug: Web/API/Document/defaultView
tags:
  - API
  - Document
  - HTML DOM
  - Property
  - Reference
browser-compat: api.Document.defaultView
---
{{ApiRef}}

In browsers, **`document.defaultView`** returns the
{{domxref("Window", "window")}} object associated with {{Glossary("Browsing_context", "a
  document")}}, or `null` if none is available.

## Syntax

```js
var win = document.defaultView;
```

This property is read-only.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
