現在、次のコードを使用しています。要素を複製し、複製の入力を必要なものに変更します。クローンにも選択があり、その名前を別の値に変更する必要があります。同じ clone コマンドで同時に 2 つの子を実行するにはどうすればよいですか?
コード:
$(this).parent().parent()
.append($(this).parent()
.clone()
.children('input').attr('name', VAL)
.end()
);
私はこのようなものが必要です
$(this).parent().parent()
.append($(this).parent()
.clone()
.children('input').attr('name', VAL)
.children('select').attr('name', VAL2) // Where this does not target children of the input, but of the clone.
.end()
);