您现在的位置是:首页 > 电脑技术查询 > web开发

粘贴到文本控件后触发的事件叫什么?解决思路

编辑:chaxungu时间:2022-10-02 23:21:51分类:web开发

粘贴到文本控件后触发的事件叫什么?
看了很多的资料都不正是实现,我想实现的是在一个文本框的粘贴了之后把多余的空格去掉,在提交后是可以实现,只不过想更直观点,还请大家多帮忙呀!

<input type= "text " id= "result2 " onkeyup= "$(this.id) "onmouseup= "$(this.id) ">
<script>
function $(a)
{
var d=/[ ]/g;
document.getElementById(a).value=document.getElementById(a).value.replace(d, " ");
}
</script>

------解决方案--------------------
onpaste