javascript how to detect on screen change code example Example: js detect screen size change window.onresize = function(){ console.log("resize"); }