現在、.clickイベントを介して入力を追加しており、この入力で発生するキー押下をリッスンしたいと考えています。ただし、追加されたものは、挿入された後はイベントを発生させません(つまり、ぼかし、キー押下、フォーカス)。誰か提案はありますか?前もって感謝します!
$("#recipientsDiv").click(function(){
$(this).append('< input type="text" id="toInput" class="inlineBlockElement" style="border:0px none #ffffff; padding:0px; width:20px; overflow:hidden;" />')
$("#toInput").focus();
});
$("input").keypress(function(e){
var inputStr = $(this).html();
$("#inputCopier").text(inputStr);
var newWidth = $("#inputCopier").innerWidth;
$(this).css("width", newWidth);
});
$("#toInput").blur(function(){
$("#toInput").remove();
});
.keyup .keydownも試しましたが、機能しません。