js detect screen size change with value code example Example: js detect screen size change window.onresize = function(){ console.log("resize"); }