<body>
      <p>Click here to check out the error:</p>
      
      <form>
         <input type="button" value="Hold Tight!" onclick="myFunc();" />
      </form>
      
   </body>
 window.onerror = function () {
               alert("An error occurred.");
            }

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.