Source Code:
(back to article)
Submit
Result:
Report an issue
<script> // Function to display current screen orientation function displayOrientation() { alert('Current Orientation: ' + screen.orientation.type); } </script> <div> <button onclick="displayOrientation()">Check Orientation</button> </div>