Screen: orientationchange event - Web APIs | MDN
Syntax
Use the event name in methods like addEventListener(), or set an event handler property.
js
addEventListener("orientationchange", (event) => { })
onorientationchange = (event) => { }
Event type
A generic Event.
Specifications
This feature is not part of any specification. It is no longer on track to becoming a standard.
Use the ScreenOrientation change event instead.