Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 464675 of ClipboardEvent()

  • Revision slug: Web/API/ClipboardEvent.ClipboardEvent
  • Revision title: ClipboardEvent.ClipboardEvent()
  • Revision id: 464675
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{APIRef("ClipboardEvent")}}{{SeeCompatTable}}

The ClipboardEvent() constructor returns a newly created {{domxref("ClipboardEvent")}}, representing an event events providing information related to modification of the clipboard, that is {{event("cut")}}, {{event("copy")}}, and {{event("paste")}} events.

Syntax

clipboardEvent = new ClipboardEvent(type, {dataType: aMimeType, 
                                           data    : someData});

Arguments

The ClipboardEvent() constructor also inherits arguments from {{domxref("Event.Event", "Event()")}}.

type
Is a {{domxref("DOMString")}} representing the name of the type of the ClipboardEvent. It is case-sensitive and can be: 'copy', 'cut', or 'paste'.
dataType
Is a {{domxref("DOMString")}} containing the MIME-type of the data contained in the data argument.
data
Is a {{domxref("DOMString")}} containing the data concerned by the clipboard event.

Specifications

Specification Status Comment
{{ SpecName('Clipboard API', '#idl-def-ClipboardEventInit', 'ClipboardEvent()') }} {{ Spec2('Clipboard API') }} Initial definition.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}

See also

  • Copy-related events: {{CopyRelatedEvents()}}
  • The {{domxref("ClipboardEvent")}} interface it belongs to.

Revision Source

<p>{{APIRef("ClipboardEvent")}}{{SeeCompatTable}}</p>
<p>The <code><strong>ClipboardEvent()</strong></code> constructor returns a newly created {{domxref("ClipboardEvent")}}, representing an event events providing information related to modification of the clipboard, that is {{event("cut")}}, {{event("copy")}}, and {{event("paste")}} events.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="syntaxbox">
<em class="brush: js">clipboardEvent</em> = new ClipboardEvent(<em>type<code>, </code></em>{dataType: <em>aMimeType</em>, 
                                           data    : <code><em>someData</em></code>});
</pre>
<h3 id="Arguments">Arguments</h3>
<p><em>The <code>ClipboardEvent()</code></em><em> constructor also inherits arguments from {{domxref("Event.Event", "Event()")}}.</em></p>
<dl>
  <dt>
    <em>type</em></dt>
  <dd>
    Is a {{domxref("DOMString")}} representing the name of the type of the <code>ClipboardEvent</code>. It is case-sensitive and can be: <code>'copy'</code>, <code>'cut'</code>, or <code>'paste'</code>.</dd>
  <dt>
    <code>dataType</code></dt>
  <dd>
    Is a {{domxref("DOMString")}} containing the MIME-type of the data contained in the <code>data</code> argument.</dd>
  <dt>
    <code>data</code></dt>
  <dd>
    Is a {{domxref("DOMString")}} containing the data concerned by the clipboard event.</dd>
</dl>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('Clipboard API', '#idl-def-ClipboardEventInit', 'ClipboardEvent()') }}</td>
      <td>{{ Spec2('Clipboard API') }}</td>
      <td>Initial definition.</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li>Copy-related events: {{CopyRelatedEvents()}}</li>
  <li>The {{domxref("ClipboardEvent")}} interface it belongs to.</li>
</ul>
Revert to this revision