unable to bind click event to nested li in jquery
<p>I have done a lot but nothing is working anymore, i would like to do when i click on td then it will take the id of that td and this id will go to the database and it will fetch all the childs of that id. now i want to append those childs to that td based on id. But when i click on the nested td it take the id of parent. Here is my code.</p>

<pre><code>&lt;script type="text/javascript" &gt;
$(document).ready(function() {
       var url = document.URL;
       var parts = url.split("/");
       var t = "";
       for(var i=0; i&lt;parts.length-1; i++) {
            t += parts[i] + "/";
       }
       var which_li = "";
      $("td").bind('click',function(e) {
             e.stopPropagation();
             which_li = $(this).attr("id");

             $.ajax({   
                 type: "POST",
                 data : {id : which_li},
                 cache: false,  
                 url: t+"treeData",   
                 success: function(data){
                     var childs = data.split(",");
                     var res = "&lt;table style='border:1px solid #ddd'&gt;&lt;tr&gt;";
                     for(var i=0; i&lt;childs.length; i++ ){
                         if(childs[i] != "") {
                             res += "&lt;td id='"+childs[i]+"'&gt;"+childs[i]+"&lt;/td&gt;";                                                         
                         }                                               
                     }
                     res += "&lt;/tr&gt;&lt;/table&gt;"
                     $("td[id='" + which_li +"']").append(res);     
                 }
             }); 
      });   
});
&lt;/script&gt;
</code></pre>

<p>Html table with default id that will be the root of all the id :</p>

<pre><code>  &lt;table id="data" style=" margin:0 auto; border:1px solid #ddd" &gt;
    &lt;tr&gt;
         &lt;td id='2'&gt;2&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
</code></pre>

<p>it's working only once but after that it only taking the id of parent td not child td. 
Please help me to short out this problem.</p>

<pre><code>e.stopPropagation();
</code></pre>

<p>Stop Propagation is also not working anymore.</p>

<p>here is my sql table </p>

<pre><code>create table user_login (
        id int not null auto_increment,
        parent int not null
);
</code></pre>

<hr>

<p>my table structure would be like this :</p>

<pre><code>// this is my table strucutre
&lt;table id="data" &gt;
     &lt;tr&gt;  
          &lt;td id="2"&gt;2
               &lt;table&gt;
                   &lt;tr&gt;
                       &lt;td id="24"&gt;24
                             &lt;table&gt;
                                &lt;tr&gt;
                                    &lt;td id="29"&gt;29&lt;/td&gt;
                                    &lt;td id="30"&gt;30&lt;/td&gt;
                                &lt;/tr&gt;
                             &lt;/table&gt;
                       &lt;/td&gt;
                       &lt;td id="25"&gt;25&lt;/td&gt;
                       &lt;td id="26"&gt;26&lt;/td&gt;
                   &lt;/tr&gt;
               &lt;/table&gt;
          &lt;/td&gt;
     &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>when i will click on id 2 then a table will append to td containing childs 24,25,26 and when i will click on 24 then a table will append to td containing childs 29,30 and so on.</p>

<p>but when i want to get the id of 24 or 25 then it's giving me id of parent td that is 2 every time. Please help me.</p>
