I want to trigger an event when a user pastes.
I have a contenteditable div and when the user pastes I want to capture the event and then focus back into the contenteditable div at the end of the paste which does not happen by default.
Ideas?
Thanks
I want to trigger an event when a user pastes.
I have a contenteditable div and when the user pastes I want to capture the event and then focus back into the contenteditable div at the end of the paste which does not happen by default.
Ideas?
Thanks
I do not know, if this works cross-browser, it's working in Chrome:
$('body').bind('paste',function(){alert(1)});
You can bind to the 'paste' event -
jQuery(document).bind('paste', function(e){ alert('pasting!') })