Tabs & Autocomplete

Tabs & Autocomplete

I am building an application and using tabs to load the content thru ajax requests. On one page I have content that is dynamicly loaded but I want to add an autocomplete option to the field.

The data I get back from my request is HTML. Is there any way to hook a autocomplete to an input field in the HTML on the fly?

This what i do:
  1.     $("a.manage").live("click", function(event,ui) {                                        
  2.         $.ajax({
  3.             get the data from a PHP file and get HTML code back
            });

  4.      
    // find the input in the HTMLthat was returned and hook a autocomplete to it..

  5.                 $("#inhoud").find("#username").autocomplete({
                        source: availableTags // using demo code right now
                    });
        });



  6. Any ideas?