Why is it not my eventhandler working

Why is it not my eventhandler working

Below is a snipped of the code I use.
I try to establish an event handler that should be called when I click on a div with
id = '10_' + vesselID + '_3');
but the event handler is never being called so no JQuery-UI dialog is displayed

What should I so the event handler is being called ?

function AddSlot(track, type, minStart, minEnd, confirmed, bookingTime, vesselID)
   {
       //Create a div element
       slot = document.createElement("div");


       if (type == "closing" && vesselID == 100)
       {
           slot.setAttribute('id', '10_' + vesselID + '_3');

           $('#10_' + vesselID + '_3').click(function ()
               {
                   $("#dlgBooking").dialog({
                       width: 230
                   });
               });
       }
       track.appendChild(slot);
   }

//Tony