oncopy Event in JavaScript
oncopy Event in JavaScript
The oncopy event is used to occur when a user copies the content of an element. It is mostly used with text and inputs.
Methods used for copying are:-
- Select Copy from Edit menu in browser
- Press CTRL + C
- Right click to display context menu and select Copy command
Syntax:-
Its syntax is:- < anyElement oncopy="my_script" > OR object.oncopy = function(){my_script} OR object.addEventListener("copy", my_script)