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 1037802 of paste

  • Revision slug: Web/Events/paste
  • Revision title: paste
  • Revision id: 1037802
  • Created:
  • Creator: Nickolay
  • Is current revision? Yes
  • Comment I updated https://developer.mozilla.org/en-US/docs/Web/Events/copy , this page needs a similar update.

Revision Content

{{EventRef}}

This page needs to be updated to match the currently specified behaviour. In the meantime please refer to the specification: https://www.w3.org/TR/clipboard-apis/#the-paste-action

The paste event is fired when a selection has been pasted from the clipboard to the document.

Bubbles Yes
Cancelable Yes
Target objects {{domxref("DefaultView")}}, {{domxref("Document")}}, {{domxref("Element")}}
Interface {{domxref("ClipboardEvent")}}

Properties

Property Type Description
target {{ReadOnlyInline}} {{domxref("EventTarget")}} The event target (the topmost target in the DOM tree).
type {{ReadOnlyInline}} {{domxref("DOMString")}} The type of event.
bubbles {{ReadOnlyInline}} boolean Does the event normally bubble?
cancelable {{ReadOnlyInline}} boolean Is it possible to cancel the event?
clipboardData {{ReadOnlyInline}} {{domxref("DataTransfer")}} The contents of the clipboard. Not only text, but also files and images.

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{ CompatUnknown() }} {{ CompatUnknown() }} {{CompatVersionUnknown}}
clipboardData {{CompatVersionUnknown}} {{ CompatGeckoDesktop(22) }} {{ CompatNo() }} {{ CompatUnknown() }} {{CompatVersionUnknown}}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
clipboardData {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
  • {{Event("copy")}}
  • {{Event("cut")}}

Revision Source

<p>{{EventRef}}</p>

<div class="warning">
<p>This page needs to be updated to match the currently specified behaviour. In the meantime please refer to the specification: <a href="https://www.w3.org/TR/clipboard-apis/#the-paste-action">https://www.w3.org/TR/clipboard-apis/#the-paste-action</a></p>
</div>

<p>The paste event is fired when a selection has been pasted from the clipboard to the document.</p>

<table class="properties">
 <tbody>
  <tr>
   <td>Bubbles</td>
   <td>Yes</td>
  </tr>
  <tr>
   <td>Cancelable</td>
   <td>Yes</td>
  </tr>
  <tr>
   <td>Target objects</td>
   <td>{{domxref("DefaultView")}}, {{domxref("Document")}}, {{domxref("Element")}}</td>
  </tr>
  <tr>
   <td>Interface</td>
   <td>{{domxref("ClipboardEvent")}}</td>
  </tr>
 </tbody>
</table>

<h2 id="Properties">Properties</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Property</th>
   <th scope="col">Type</th>
   <th scope="col">Description</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><code>target</code> {{ReadOnlyInline}}</td>
   <td>{{domxref("EventTarget")}}</td>
   <td>The event target (the topmost target in the DOM tree).</td>
  </tr>
  <tr>
   <td><code>type</code> {{ReadOnlyInline}}</td>
   <td>{{domxref("DOMString")}}</td>
   <td>The type of event.</td>
  </tr>
  <tr>
   <td><code>bubbles</code> {{ReadOnlyInline}}</td>
   <td><code>boolean</code></td>
   <td>Does the event normally bubble?</td>
  </tr>
  <tr>
   <td><code>cancelable</code> {{ReadOnlyInline}}</td>
   <td><code>boolean</code></td>
   <td>Is it possible to cancel the event?</td>
  </tr>
  <tr>
   <td><code>clipboardData</code> {{ReadOnlyInline}}</td>
   <td>{{domxref("DataTransfer")}}</td>
   <td>The contents of the clipboard. Not only text, but also files and images.</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 (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>clipboardData</code></td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{ CompatGeckoDesktop(22) }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatUnknown() }}</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&nbsp;Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
  <tr>
   <td><code>clipboardData</code></td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="Related_events">Related events</h2>

<ul>
 <li>{{Event("copy")}}</li>
 <li>{{Event("cut")}}</li>
</ul>
Revert to this revision