Как определить поведение копирования, вставки и вырезания с помощью jQuery
Чтобы обнаружить поведение копирования, вставки и вырезания, вам просто нужно связать соответствующий тип события.
$("#textA").bind('copy', function() { $('span').text('copy behaviour detected!') }); $("#textA").bind('paste', function() { $('span').text('paste behaviour detected!') }); $("#textA").bind('cut', function() { $('span').text('cut behaviour detected!') });
Если вы используете jQuery 1.4x, он поддерживает объявление нескольких событий, например:
$("#textA").bind({ copy : function(){ $('span').text('copy behaviour detected!'); }, paste : function(){ $('span').text('paste behaviour detected!'); }, cut : function(){ $('span').text('cut behaviour detected!'); } });