diff --git a/files/en-us/web/api/errorevent/index.md b/files/en-us/web/api/errorevent/index.md index 98adc0348a7af88..21d271c6ce1df0c 100644 --- a/files/en-us/web/api/errorevent/index.md +++ b/files/en-us/web/api/errorevent/index.md @@ -21,7 +21,7 @@ The **`ErrorEvent`** interface represents events providing information related t _Also inherits properties from its parent {{domxref("Event")}}_. - {{domxref("ErrorEvent.message")}} {{ReadOnlyInline}} - - : A string containing a human-readable error message describing the problem. Lacking a [`crossorigin`](/en-US/docs/Web/HTML/Attributes/crossorigin) setting reduces error logging. + - : A string containing a human-readable error message describing the problem. - {{domxref("ErrorEvent.filename")}} {{ReadOnlyInline}} - : A string containing the name of the script file in which the error occurred. - {{domxref("ErrorEvent.lineno")}} {{ReadOnlyInline}} diff --git a/files/en-us/web/api/errorevent/message/index.md b/files/en-us/web/api/errorevent/message/index.md new file mode 100644 index 000000000000000..989c4dd369c96b6 --- /dev/null +++ b/files/en-us/web/api/errorevent/message/index.md @@ -0,0 +1,31 @@ +--- +title: "ErrorEvent: message property" +short-title: message +slug: Web/API/ErrorEvent/message +page-type: web-api-instance-property +browser-compat: api.ErrorEvent.message +--- + +{{APIRef("HTML DOM")}}{{AvailableInWorkers}} + +The **`message`** read-only property of the {{domxref("ErrorEvent")}} interface returns a string containing a human-readable error message describing the problem. + +## Value + +A string. + +## Examples + +```js +window.addEventListener("error", (ev) => { + console.log("The error message: " + ev.message); +}); +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}}