Orientation Change using orientationchange event

by shivkumarganesh

JavaScript

window.addEventListener("orientationchange", function() {
    alert("the orientation of the device is now " + screen.orientation.angle);
});