jquery livequery problem
<p>i dynamically load html elements..
and used livequery() plugin to handle click events..
but only the first element could be clicked.</p>

<p>here's my initial DOM:</p>

<pre><code> &lt;div id="styleList"&gt;
            &lt;h4 class="subPaneTitle blurred"&gt;List of themes&lt;/h4&gt;
            &lt;ul&gt;
                &lt;li class="listHeader"&gt;&lt;span class="themeID"&gt;Theme ID&lt;/span&gt;&lt;span class="themeName"&gt;Theme Name&lt;/span&gt;
                         &lt;span class="themeAction"&gt;Action&lt;/span&gt;
                &lt;/li&gt;
            &lt;/ul&gt;
            &lt;p class="createNewStyle clearfix"&gt;&lt;a id="createNewStyle" class="btnStyle1 blurred ui-corner-all"&gt;Create new theme&lt;/a&gt;&lt;/p&gt;
        &lt;/div&gt;
</code></pre>

<p>here's my code to load dynamically the elements from xml:</p>

<pre><code>    $.get("http://localhost/ShopNGo_Blitz_revised_w_YAML/site_styles_list.xml",loadAllThemes);


    function loadAllThemes(data){
    $(data).find("style").each(function(){
     var thisStyle = $(this);
     var styleID = thisStyle.attr('id');
     var styleName = thisStyle.attr('name');
     var styleStatus = "";
     if(thisStyle.attr('status') == "used"){
      styleStatus = '&lt;span class="statusIndicator"&gt;Current theme&lt;/span&gt;';
     }
     $("#styleList ul").append('&lt;li&gt;&lt;span class="themeID"&gt;'+ styleID + '&lt;/span&gt;&lt;span class="themeName"&gt;' + styleName + '&lt;/span&gt;&lt;span class="themeAction"&gt;&lt;a id="themePreview"&gt;Preview&lt;/a&gt;&lt;/span&gt;&lt;span class="themeAction"&gt;&lt;a id="themeEdit"&gt;Edit&lt;/a&gt;&lt;/span&gt;&lt;span class="themeAction"&gt;&lt;a id="themeDelete"&gt;Delete&lt;/a&gt;&lt;/span&gt;&lt;span class="themeAction"&gt;&lt;a id="themeUse"&gt;Use&lt;/a&gt;&lt;/span&gt;' + styleStatus + '&lt;/li&gt;');

    });
}
</code></pre>

<p>here's my code for the 'Edit' click event:</p>

<pre><code>    $("div#styleList").find("ul").find("li").find("a#themeEdit").livequery("click",function(){ //this gets only the first element.
 var themeName = $(this).parent().prev().prev(".themeName").text();
 $("#siteStyleContent").tabs("select","#styleEditTabs");
 $("div#styleEditTabs").children("#themeName").text(themeName);
});
</code></pre>
