Having troubles with cloned fields

Having troubles with cloned fields

Hi, how are you?
It's my first time in the forum and my english is not very good, so I'll try to explain myself good hehe.

I've this code:

  1. var i = $('.detalle fieldset').size() + 0;
  2.     $("a#add").click(function(){
  3.         $('<fieldset class="articulos" id="'+ i +'"><input name="articulo[' + i + '][nombre]" id="art_nombre" value="" /><input name="articulo[' + i + '][cantidad]" class="art_cantidad" value="" /><input name="articulo[' + i + '][preciou]" class="art_preciou" value="" /><input name="articulo[' + i + '][descuento]" class="art_desc" value="" /><input name="articulo[' + i + '][precio]" class="art_precio" value="" /></fieldset> ').appendTo(".detalle");
  4.         $('.detalle fieldset .art_cantidad, .detalle fieldset .art_preciou, .detalle fieldset .art_desc').on('input',function() {
  5.             var qty = parseInt($('.detalle fieldset .art_cantidad').val());
  6.             var price = parseFloat($('.detalle fieldset .art_preciou').val());
  7.             var desc = parseFloat($('.detalle fieldset .art_desc').val());
  8.             if($('.detalle fieldset .art_desc').val()==''){
  9.                 $('.detalle fieldset .art_precio').val((qty * price ? qty * price : 0).toFixed(2));
  10.             } else {
  11.                 $('.detalle fieldset .art_precio').val(((qty * price ? qty * price : 0) - desc).toFixed(2));
  12.             }
  13.         });

  14.         i++;

When I clone the fieldset, for example two times, the second fieldset not work. I thing is something about the classname or something like that, I just don't know.

Thanks