How to detect Ctrl+V, Ctrl+C using JavaScript?

前端 未结 17 2127
走了就别回头了
走了就别回头了 2020-11-22 13:47

How to detect ctrl+v, ctrl+c using Javascript?

I need to restrict pasting in my textareas, end user should not copy and p

17条回答
  •  星月不相逢
    2020-11-22 14:46

    Don't forget that, while you might be able to detect and block Ctrl+C/V, you can still alter the value of a certain field.
    Best example for this is Chrome's Inspect Element function, this allows you to change the value-property of a field.

提交回复
热议问题