Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p>This example uses the addEventListener() method to attach a "resize" event on the window object.</p> <p>Try to resize the browser window.</p> <p>Window resized <span id="demo">0</span> times.</p> <script> window.addEventListener("resize", myFunction); var x = 0; function myFunction() { var txt = x += 1; document.getElementById("demo").innerHTML = txt; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onresize_window by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:29:39 GMT --> </html>
Result:
Try it Yourself - © w3schools.com