select elements

select elements

hi, I create a list from data in db, then I would get the text in the list by click on mouse
  1. for(var i in data){ 
  2.              reparto = data[i];
  3.              $('#list ul').append('<li class="list-group-item">'+reparto[1]+'</li>');
  4.             
  5.           }
  6.       } 
  7.     });
  8.     
  9.     $('#list li').click(function() {
  10.         alert( $(this).text() );
  11. });
But when  I click on a element of the list don't catch it, if I write in html code an element in the list I can catch 
why?
thanks a lot