How do I get orientation in Javascript?
“how to get orientation in js” Code Answerif (window. matchMedia(“(orientation: portrait)”). matches) {// you’re in PORTRAIT mode.}if (window. matchMedia(“(orientation: landscape)”). matches) {// you’re in LANDSCAPE mode.}