Advertisement
Home Open Editor ❯

HTML onpaste Attribute

Example

<input type="text" onpaste="myFunction()" value="Try to paste text!">

Try this code ❯

Meaning

The onpaste attribute specifies the script to be run when the user pastes some content in an element.


Standard Syntax

<element onpaste="script">


Applies to:

The onpaste attribute can be used on the following element:

Element Attribute
All HTML elements. onpaste

Advertisement

Attribute Values

Value Description
script Specifies the script to be run on onpaste.
Home Open Editor ❯
Advertisement