---
title: ScreenOrientation.onchange
slug: Web/API/ScreenOrientation/onchange
tags:
  - API
  - Orientation
  - Property
  - Reference
  - Screen Orientation API
  - ScreenOrientation
  - Unlock
browser-compat: api.ScreenOrientation.onchange
---
{{APIRef("Screen Orientation")}}

The **`onchange`** property of the
{{domxref("ScreenOrientation")}} is an event handler fired whenever is the
[event handler](/en-US/docs/Web/Events/Event_handlers) called when the screen changes orientation.

## Syntax

```js
screen.orientation.addEventListener('change', function(e) { ... })
screen.orientation.onchange = function(e) { ... }
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
