How to use JQuery to detect value-changed event when user drag & drop text into textbox?

前端 未结 3 838
小鲜肉
小鲜肉 2021-01-03 14:53

I\'m using this jQuery code

$(\'input\').bind(\'change mouseup\', ... )

to detect if user drag text somewhere into my input & change it

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-03 15:24

    jQuery 1.10.1 - I had success with this...

    $('body').on('input paste drop', '#txt-some-id, function() {
        $('#btn-some-id').prop("disabled", $(this).val().length === 0);
    });
    

提交回复
热议问题