Clone + autocomplete not workink

Clone + autocomplete not workink

I can not understand where the problem is.

Could you give me a hint on how to solve this?

  1. var buttonadd = '<span><button class="btn btn-success btn-add" type="button"><span class="glyphicon glyphicon-plus"></span></button></span>';
  2.                 var fvrhtmlclone = '<div class="fvrclonned">' + $(".fvrduplicate").html() + buttonadd + '</div>';
  3.                 $(".fvrduplicate").html(fvrhtmlclone);
  4.                 $(".fvrduplicate").after('<div class="fvrclone"></div>');
  5.                 $(document).on('click', '.btn-add', function (e)
  6.                 {
  7.                     e.preventDefault();
  8.                     $(".fvrclone").append(fvrhtmlclone);
  9.                     $(this).removeClass('btn-add').addClass('btn-remove')
  10.                             .removeClass('btn-success').addClass('btn-danger')
  11.                             .html('<span class="glyphicon glyphicon-minus"></span>');
  12.                 }).on('click', '.btn-remove', function (e)
  13.                 {
  14.                     $(this).parents('.fvrclonned').remove();
  15.                     e.preventDefault();
  16.                     return false;
  17.                 });

  18. var availableTags = [
  19.             "ActionScript",
  20.             "AppleScript",
  21.             "Asp",
  22.             "BASIC",
  23.             "C",
  24.             "C++",
  25.             "Clojure",
  26.             "COBOL",
  27.             "ColdFusion",
  28.             "Erlang",
  29.             "Fortran",
  30.             "Groovy",
  31.             "Haskell",
  32.             "Java",
  33.             "JavaScript",
  34.             "Lisp",
  35.             "Perl",
  36.             "PHP",
  37.             "Python",
  38.             "Ruby",
  39.             "Scala",
  40.             "Scheme"
  41.         ];

  42. $("#auto").autocomplete({
  43.     source: function (request, response) {
  44.         var results = $.ui.autocomplete.filter(availableTags, request.term);
  45.         
  46.         if (!results.length) {
  47.             $("#no-results").text("No results found!");
  48.         } else {
  49.             $("#no-results").empty();
  50.         }
  51.         
  52.         response(results);
  53.     }
  54. });

Here my code with problem:  Code