[英]How to add onpaste event to future created element
I am trying to bind onpaste event to all the elements inside container, using jquery 我正在尝试使用jQuery将onpaste事件绑定到容器内的所有元素
$('.container').on("paste","*",function(e){});
But on my browser this is not working, and i think now their is no on paste
event exist in jquery, So i think i must use javascript 但是在我的浏览器上,这是行不通的,我想现在他们在jQuery中不存在
on paste
事件,所以我认为我必须使用JavaScript
$('.container')[0].addEventListener("paste",function(e){});
This works fine but only works for class container , how can i bind this handler to all the future created elements in container 这工作正常,但仅适用于类容器,我如何将此处理程序绑定到容器中所有将来创建的元素
Any idea? 任何想法?
您是否尝试过:
$(".container").bind("paste", function(e){});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.