HTML oncopy Attribute

❮ HTML Attributes

Example

<input type="text" oncopy="myFunction()" value="Try to copy this text.">

Meaning

The oncopy attribute specifies the script to be run when the user copies the content of an element.




Standard Syntax

<element oncopy="script">



Browser Support




Status




Applies to:

The oncopy attribute can be used on the following element:

Element Attribute
All HTML elements oncopy






Attribute Values

Value Description
script Specifies the script to be run on oncopy
❮ HTML Attributes