Javascript examples for DOM:Error
JavaScript Error name Property - SyntaxError, A syntax error has occurred
<!DOCTYPE html> <html> <body> <h1>JavaScript Errors</h1> <p>You cannot evaluate code that contains a syntax error:</p> <p id="demo"></p> <script> try {/* w w w.j a v a 2 s.c o m*/ eval("console.log('Hello)"); } catch(err) { document.getElementById("demo").innerHTML = err.name; } </script> </body> </html>