当前位置: 代码迷 >> JavaScript >> 粘贴到文本控件后触发的事件叫什么?解决思路
  详细解决方案

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

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

<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
  相关解决方案