开发者

Detecting html textarea's change

I'd like to monitor my textarea's changes with jQuery. I can do this with the keyup event and it works perfectly. But what event I can get when a user click on the textarea (right mouse click), then choose paste?

Click event oc开发者_Go百科cur only when the user click with the left mouse button on the textarea.

How can I handle this situation?


you can detect Pastes or Cuts into the textarea by:

$("#TextBox1").bind('paste', function(e) {
            alert('pasting text!');
        });
$("#TextBox1").bind('cut', function(e) {
            alert('cut text!');
        });

Or combine:

$("#Text1").bind('cut paste', function(e) {
    alert(e.type + ' text!');
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜