jQuery event detection - delete input box text with mouse, drag text to input box

前端 未结 1 917
逝去的感伤
逝去的感伤 2021-02-14 23:54

I\'m able to detect the cut, copy, paste events with the following code

$(\'#searchInput\').bind(\'cut copy paste\', function (e) {
  setTimeout(\"         


        
1条回答
  •  广开言路
    2021-02-15 00:44

    I was able to get binding to work for these events cut copy paste mousedown mouseup focus blur

    which should cover you on delete, drag out, drag in circumstances but you won't necessarily know that much detail just that the field has changed and which bound event caused the change, I think you'd also have to keep tabs on the current/previous value of the input field between events.

    Here's the jsfiddle I was playing with http://jsfiddle.net/9aRxb/1/

    0 讨论(0)
提交回复
热议问题