gpt4 book ai didi

jquery - 检测输入框上的粘贴

转载 作者:行者123 更新时间:2023-12-03 22:11:57 25 4
gpt4 key购买 nike

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

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

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

最佳答案

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

    $(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!');
});
});

关于jquery - 检测输入框上的粘贴,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1601353/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com