I have a little trouble catching a pasted text into my input:
<input type="text" id="myid" val="default">
$('#myid').on('paste',function(){
console.log($('#myid').val());
});
console.log shows:
default
How I catch
the pasted text and get ready to use?
The accepted answer is actually hacky and ugly, seems to be suggested quite often for the paste event on stackoverflow. I think a better way to do it is this
$('#someInput').bind('paste', function(e) {
var data = e.originalEvent.clipboardData.getData('Text');
//IE9 Equivalent ==> window.clipboardData.getData("Text");
});