zig.com Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body onbeforeunload="return myFunction()">
<h1>HTML DOM Events</h1>
<h2>The beforeunload Event</h2>
<p>Reload this page, or click on the link below to invoke the onbeforeunload event.</p>
<a href="../index.html">Click here to go to w3schools.com</a>
    
<script>
  function myFunction() {
    return "Write something clever here...";
  }
</script>
</body>
<!-- /jsref/tryit.asp?filename=tryjsref_onbeforeunload 
</html>