event handlers

event handlers

I'm sure this is a very newb question, but why doesn't this work? I'm trying to add buttons to dynamically created elements, but I can't seem to figure out how to attach event listeners to them. The icon is added, but nothing happens when you click on it...!

icn = "<div class='icon'/>" ;
$(icn).click(function(){
   alert('clicked') ;
});
$("#functions").append( $(icn) ) ;




thanks...