ClipboardChangeEvent: ClipboardChangeEvent() constructor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The ClipboardChangeEvent() constructor creates a new ClipboardChangeEvent object instance when a clipboardchange event occurs. The clipboardchange event fires whenever the system clipboard contents are changed either by a web app or any other system application.

Note: This event constructor is generally not needed for production websites. Its primary use is for tests that require an instance of this event.

Syntax

js
new ClipboardChangeEvent(type)
new ClipboardChangeEvent(type, options)

Parameters

type

A string with the name of the event. It should always be set to clipboardchange.

options Optional

An object that, in addition to the properties defined in Event(), can have the following properties:

types

An array of strings representing the data types available on the system clipboard.

changeId

An integer representing a unique identifier for the clipboard change operation.

Return value

A new ClipboardChangeEvent object.

Specifications

Specification
Clipboard API and events
# dom-clipboardchangeevent-clipboardchangeevent

Browser compatibility