Source Code: (back to article)
<script>
// Function to display current screen orientation
function displayOrientation() {
alert('Current Orientation: ' + screen.orientation.type);
}
</script>

<div>
<button onclick="displayOrientation()">Check Orientation</button>
</div>