JSFiddle - React, Tailwind, and code Playground

by dmethvin

HTML

<input type=text >

JavaScript

var pasteCatcher = $(document.createElement("div"));
pasteCatcher
  .attr("contenteditable","true")
  .css({width : "0", height : "0", overflow : "hidden", outline : 0}); $("body").prepend(pasteCatcher);

pasteCatcher.on("focus", function(){
    console.log("focused jQuery")
});
pasteCatcher[0].addEventListener("focus", function(){
    console.log("native focused");
}, false);

$(document).bind("paste", function() {
    pasteCatcher.focus();  // doesn't work
   // pasteCatcher[0].focus() // works
});