addeventlistener resize width code example Example: add event listener on width screen resize window.addEventListener('resize', reportWindowSize);