I am new to Java Script. In the code below, I am trying to create an error intentionally to find out how to try ... to catch the job. But nothing works.
<html>
<body>
<p id="demo"></p>
<script>
try {
adddlert("Hi User!");
}
catch(Error e) {
document.getElementById("demo").innerHTML = e.message;
}
</script>
</body>
</html>
What am I missing?
Rajuu source
share