简体   繁体   中英

How to add onpaste event to future created element

I am trying to bind onpaste event to all the elements inside container, using jquery

$('.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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM