JavaScript Error name Property SyntaxError

Introduction

SyntaxError: A syntax error has occurred

View in separate window

<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>

<script>
try {// www  . j a  v a 2  s .  co  m
  eval("alert('Hello)");
}
catch(err) {
  document.getElementById("demo").innerHTML = err.name;
}
</script>

</body>
</html>



PreviousNext

Related