Notification.onclick

Did you know that you can read content offline by using one of these tools? If you would like to read offline MDN content in another format, let us know by commenting on Bug 665750.

Dash App

« DOM Reference

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.

Summary

Specifies an event listener to receive click events. These events occur when the user clicks on a displayed Notification.

Syntax

instanceOfNotification.onclick = funcRef;

Where funcRef is a function to be called when the click event occurs.

Specifications

Specification Status Comment
Web Notifications Working Draft Initial specification.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 5 webkit (see notes)
22
4.0 moz (see notes)
22
Not supported ? 6 (see notes)
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? 4.0 moz (see notes)
22
Not supported ? ?

Gecko notes

  • Prior to Firefox 22, the instantiation of a new notification must be done with the navigator.mozNotification object through its createNotification method.
  • Prior to Firefox 22, the Notification was displayed when calling the show method and was supporting the click and close events only.

Chrome notes

Safari notes

  • Safari started supporting notification with Safari 6 but only on Mac OSX 10.8+ (Moutain Lion).

See also

Tags (7)