入力フィールドにマスクを追加するという一見不可能なタスクを達成しようとしています。
次のコードがあります。
function addActivationCode(){
newRow = jQuery("div.activationcode:last-child").clone();
newRow.insertAfter(jQuery("div.activationcode:last-child"));
newRow.attr("id", "coderow-" + Math.round(Math.random() * 10000));
newRow.find("input").val("");
find("input").mask("9999-9999-9999-9999");
newRow.find("a.coderemove").attr("onclick", "removeActivationCode('" + newRow.attr("id") + "'); return false;");
}
function removeActivationCode(id){
jQuery("div#" + id).remove();
}
ここで、入力フィールドで .mask を動作させる必要があります。これまでのところ、元の行ではなく、作成中の新しい行でのみ動作しています。
誰でも私を助けることができますか?