element, unless the contenteditable attribute is set to "true" (see more examples below). **Tip:** The onpaste event is most often used with elements. **Tip:** There are three ways to paste content into an element: * Press CTRL + V * Select "Paste" from the browser's Edit menu * Right-click the mouse button and select the "Paste" command in the context menu. * * * ## Browser Support | Event | | | | | | | --- | --- | --- | --- | --- | --- | | onpaste | Yes | Yes | Yes | Yes | Yes | * * * ## Syntax In HTML: (#) In JavaScript: _object_.onpaste=function(){_myScript_};(#) In JavaScript, using the addEventListener() method: _object_.addEventListener("paste", _myScript_);(#) **Note:** Internet Explorer 8 and earlier IE versions do not support the [addEventListener()](#) method. * * * Technical Details | Bubbles: | Yes | | --- | | Cancelable: | Yes | | Event type: | ClipboardEvent | | Supported HTML tags: | All HTML elements | * * *  ## More Examples ## Example Execute JavaScript when text is pasted in a
element (note the contenteditable attribute is set to "true"):
Try pasting content in this paragraph.
[Try it Β»](#) * * * ## Related Pages HTML DOM Reference: (#) HTML DOM Reference: (#) [ Event Object](#)
YouTip