how to detect screen size javascript code example
Example 1: get window resolution javascript
var clientWidth = document.documentElement.clientWidth;
$("h2").text(clientWidth);
Example 2: js know size of screen
alert("Your screen resolution is: " + screen.width + "x" + screen.height)
Example 3: js detect screen size change
window.onresize = function(){
console.log("resize");
}