Javascript examples for DOM:Error
The message property sets or gets an error message.
A String, representing a description of an error
The following code shows how to return an error message
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> try {//from w w w .ja v a 2 s.c om functionDoesNotExist("hi!"); } catch(err) { document.getElementById("demo").innerHTML = err.message; } </script> </body> </html>