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