Home
<!DOCTYPE html> <html> <body> <h1>Demo: throw</h1> <p id="errorMessage"></p> <script> try { throw "Error occurred"; } catch(ex) { document.getElementById("errorMessage").innerHTML = ex; } </script> </body> </html>
Result: