Write an error to the console:
console.error("You made a mistake");
Press F12 on your keyboard to view the message in the console view.
<!DOCTYPE html> <html> <body> <script> console.error("You made a mistake"); </script>//from w ww .j a v a2s . co m </body> </html>
The console.error()
method writes an error message to the console.
console.error(message);
Parameter | Type | Description |
---|---|---|
message | String or Object | Required. The message or object to write as an error |