Problem with jquery.click() after writing tags with $('ul li').html(Item);

Problem with jquery.click() after writing tags with $('ul li').html(Item);

Hello,

i have a Problem with the following code after writing it with $('ul li').html(Item);

  1. $("#sideBar li").click(function() {
  2.    alert($(this).html());
  3. }
When i write the li-tags in the ul#sideBar manual, it works fine.

The following jQuery writes the li-Tags in the ul with the id "#sideBar":

  1. $.ajax({
  2.       type: 'post',
  3.       url: "ajax/getSideBar.xml",
  4.       dataType: 'xml',
  5.       global: false,
  6.       success: function(xml) {
  7.                    
  8.              var Item = '';
  9.              $(xml).find('Marker').each(function() {
  10.                   var title = $(this).find("title").text();
  11.                   Item += '<li>'+title+'</li>';
  12.               });
  13.               $('#sideBar').html(Item);
  14.        },
  15. });

That works fine too,but now the $("#sideBar li").click(function() { do nothing!?

Do you have any idears?

Greetz
Helmutha