如何使用Javascript检测ctrl+v,ctrl+c?
我的文本区域需要限制粘贴,最终用户不能复制和粘贴内容,用户只应该在文本区域键入文本。
如何做到这一点?
发布于 2018-01-18 19:16:49
使用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!')
});https://stackoverflow.com/questions/-100007172
复制相似问题