I am trying to duplicate a div with its content, inside a form. But everytime it clones outside the form.
$("#copy").click(function (e) {
var avails = $(".avail");
var cnt = avails.length + 1;
avails.eq(0).clone().insertBefore(this).find("div").attr("id", "id" + cnt).find("#senzori").attr("id", "senzori" + cnt);
$("#id" + cnt).find("#tip").attr("cnt", "senzori" + cnt);
$("#senzori" + cnt).find('option').remove().end().append('---').val('NA');
e.preventDefault();
});
Any clue how i can make it stay in the same form and not colone after ?