How to implement click event on dynamically generating ? I have a drop down select box. Through jquery on run time that drop then hides and the new drop down made which made from &lt;ul&gt; and &lt;li&gt; tags.

Now through firebug I notice that when the drop down is closed then there is one &lt;li&gt; and when I expand the drop down then in the firebug more &lt;li&gt; displayed.

So I want to implement the click event on these &lt;li&gt;.
I tried this code.

 $(document).ready(function() {
  alert('a');
  $('.fb li').each(function() {
      alert('li');
    $(this).click(function(event) { 
           alert('hed');
        var fbpage = $(this).attr("rel");
        if(fbpage != 0) {         
            window.open(''+fbpage+'', '_blank');
        }

    });
    });
    });


the alert('a') and alert('li') works but then that click event is not working.

Any idea about this? and if you does not understand my question then ask me I will explain it more.
Since you are running D6, you should look into the live() jQuery handler ( http://api.jquery.com/live/ ) that can be used to attach these click handlers to your dynamic elements.

More information on this can be found by googling or otherwise searching for

jquery click event on dynamically generated elements

You might also want to look into the Drupal.behaviors method of including jQuery and javascript instead of the $(document).ready() approach you've used.