HTML onmessage Event Attribute

Description

The event attribute onmessage is used when an object has received some message through an event source.

The event object for onmessage Event supports the following schemes:

  • data: It contains the actual message present inside it.
  • origin: It contains the URL of the document that invoked the event.
  • lastEventId: It works as descriptive attribute for the last message that was spotted in the message stream.

Syntax

<element onmessage="script">

Values

  • scriptThe name of the script to use when the event has been triggered.

Example

Currently no example, check back again soon.

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
??????
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
??????