jQuery bind to Paste Event, how to get the content of the paste

后端 未结 9 1074
温柔的废话
温柔的废话 2020-11-28 06:08

I have a jquery token tagit plugin and I want to bind to the paste event to add items correctly.

I\'m able to bind to the paste event like so:

    .b         


        
9条回答
  •  误落风尘
    2020-11-28 07:01

    Another approach: That input event will catch also the paste event.

    $('textarea').bind('input', function () {
        setTimeout(function () { 
            console.log('input event handled including paste event');
        }, 0);
    });
    

提交回复
热议问题