小编典典

检测输入框上的粘贴

jQuery

有输入框。页面加载时,我使用鼠标右键单击输入框并从上下文菜单中选择粘贴。

粘贴文本时,粘贴发生后立即使用哪个事件来提醒文本?

我使用“输入粘贴”但在 IE 中不起作用


阅读 250

收藏
2022-05-16

共1个答案

小编典典

您可以像这样绑定这些事件:

    $(document).ready(function() {
        $("#Text1").bind('copy', function(e) {
            alert('copying text!');
        });
        $("#Text1").bind('paste', function(e) {
            alert('pasting text!');
        });
        $("#Text1").bind('cut', function(e) {
            alert('cut text!');
        });
    });
2022-05-16