<p id="error"></p> <script> try { wrongalert("Welcome guest!"); } catch(err) { document.getElementById("error").innerHTML = err.message; } </script>