Mam kod dodawania wierszy (tr) w tabeli, natomiast mam mały problem

Mój kod nie dodaje id +1 dlaczego?

<script type="text/javascript"> var x = 1; $(document).ready(function() { $('#add').click(function(){ var newRow = $('#elements .element:first').clone(); newRow.find('input[name="name[0]"]').attr('id', 'name['+x+']'); newRow.find('input[id="name['+x+']"]').attr('name', 'name['+(x)+']'); newRow.find('input').val(''); newRow.appendTo($('#elements')); return false; }); }); </script>
a tu część tabeli: