$("body").on('click', '#ad', function() {
a = a + 1;
//put the attributes of the form fields to a variable
var b = 'items[' + a + '][url]';
var c = 'items[' + a + '][li_name]';
var d = 'items[' + a + '][visible]';
var e = 'items[' + a + '][veight]';
//clone the div with fields
$("#nav_field").clone().attr('id', 'nav_field_' + a).appendTo("#clon_place");
//rewrite the attribute of the cloned fields
$('#nav_field_' + a + ' select.url').attr("name", b);
$('#nav_field_' + a + ' input.li_name').attr("name", c);
$('#nav_field_' + a + ' input.visible').attr("name", d);
$('#nav_field_' + a + ' select.veight').attr("name", e);
});
Find more questions by tags HTMLJavaScriptjQuery