Javascript examples for DOM:Error
JavaScript Error name Property - TypeError: A type error has occurred
<!DOCTYPE html> <html> <body> <h1>JavaScript Errors</h1> <p>You cannot convert a number to upper case:</p> <p id="demo"></p> <script> var num = 1;//ww w . j ava2 s. c o m try { num.toUpperCase(); } catch(err) { document.getElementById("demo").innerHTML = err.name; } </script> </body> </html>