The message property sets or gets an error message.
Return an error message.
The following code has a wrong function name.
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> try {/*from w w w . ja va 2s . co m*/ notExistFunction("Welcome guest!"); } catch(err) { document.getElementById("demo").innerHTML = err.message; } </script> </body> </html>
The message property returns a String representing a description of an error.