So I have this code for cloning fields from a form to add another selection below. This part is working fine. However I am unsure of when adding the new fields, that each new field has it's own unique attributes instead of the ones that were clones. I think this may be due to the (var num = $('.clonedInput').length) portion of the script but I am unsure. I want to clone a form and have the attributes to things such as boxes and radio buttons selected unique.

 <script type="text/javascript">
        $(document).ready(function() {
            $('#btnAdd').click(function() {
                var num     = $('.clonedInput').length; 
                var newNum  = new Number(num + 1);      
                var newElem = $('#input' + num).clone().attr('', 'input' + newNum);
                newElem.children(':first').attr('', 'name' + newNum).attr('name', 'name' + newNum);
                                $('#input' + num).after(newElem);
            $('#btnDel').click(function() {
                var num = $('.clonedInput').length; 
                $('#input' + num).remove();    
                if (num-1 == 1)