How to call a function after right-clicking

I am trying to call a function after the right click insert parameter. Below is the code I tried, but it does not work for me.

$(document).ready(function(){ $('#textA').on('paste',function(){ //something... }); }); 

What is the best way to trigger an event with a right click?

0
source share
2 answers
 $(document).on('paste',function(){ //your logic }); 
0
source
 document.addEventListener('paste', function(e){ if(e.clipboardData.types.indexOf('text/html') > -1){ processDataFromClipboard(e.clipboardData.getData('text/html')); e.preventDefault(); ... } }); 

Further:

0
source

All Articles