Quote Originariamente inviata da Xinod Visualizza il messaggio
quando setti il click quell' elemento non esiste ancora, quindi il gestore evento non puo' essere settato

ti serve delegare, con .live o, per versioni di jquery piu' recenti (1.7+), .on
praticamente invece di
$('#elenco li').click(function() {
puoi scrivere
$('#elenco').on('click','li',function() {

ciao
MA $('#elenco li').click(function() { non è una shortcut al metodo .on ?

This method is a shortcut for .on( "click", handler ) in the first two variations, and .trigger( "click" ) in the third. The click event is sent to an element when the mouse pointer is over the element, and the mouse button is pressed and released. Any HTML element can receive this event. For example, consider the HTML: