The onresize property is triggered when the web browser window is resized.
You can try running the following code to implement the onresize attribute -
<!DOCTYPE html> <html> <body onresize = "display()"> <p>Resize the window to trigger event.</p> <script> function display() { alert("Web browser window resized!"); } </script> </body> </html>
The above is the detailed content of Execute a script in HTML when the browser window size changes?. For more information, please follow other related articles on the PHP Chinese website!