Source Code:
(back to article)
Submit
Result:
Report an issue
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
⌄
<
script
>
// Function to display current screen orientation
function
displayOrientation
() {
alert(
'Current Orientation: '
+ screen.orientation.type);
}
</
script
>
<
div
>
<
button
onclick=
"
displayOrientation()
"
>Check Orientation</
button
>
</
div
>
<script> // Function to display current screen orientation function displayOrientation() { alert('Current Orientation: ' + screen.orientation.type); } </script> <div> <button onclick="displayOrientation()">Check Orientation</button> </div>