I have this paste event like so:
$("body").bind("paste", function (e) {
var pastedData = e.originalEvent.clipboardData.getData('text');
console.log(pastedData);
});
Which is working great! However I also want the option get clipboardData via a click event like so:
$("#clipboard").on("click", function (e) {
$("body").trigger("paste");
});
But when I try this, I get this error:
Cannot read property 'clipboardData' of undefined
Is there away to get clipboardData via click event? Or to trigger the paste event via click event?