Display temp div in view
<p>I want to display a temp div based on my click. For example when I click on the second row, a temp div will show after the second row.</p>

<p>This is my view:</p>

<pre><code>&lt;div id="sidetree" align="center"&gt;
  &lt;div id="sidetreecontrol"&gt;
    &lt;a href="?#"&gt;Collapse All&lt;/a&gt; | &lt;a href="?#"&gt;Expand All&lt;/a&gt;
  &lt;/div&gt;
  &lt;ul class="treeview" id="tree"&gt;
    &lt;li class="expandable"&gt;
      &lt;div class="hitarea expandable-hitarea"&gt;&lt;/div&gt;
      &lt;a href="?/index.cfm"&gt;These are the Sponsors Of &lt;?=$sponsor_id;?&gt;&lt;/a&gt;
      &lt;ul style="display: none;"&gt;
      &lt;?php
        foreach($Level1Details-&gt;result() as $row){
      ?&gt;
        &lt;li id="sponsor_id"&gt;&lt;label alt="&lt;?=$row-&gt;user_id?&gt;"&gt;&lt;?=$row-&gt;user_id;?&gt;&lt;/label&gt;&lt;/li&gt;
        &lt;ul&gt;&lt;div id="levelTwo"&gt;&lt;/div&gt;&lt;/ul&gt;
        &lt;?php } ?&gt;
</code></pre>

<p>And JS:</p>

<pre><code>$(document).ready(function(){
  $('#sponsor_id label').live('click',function() {
    var sponsor_id=$(this).attr("alt");
    alert(sponsor_id);
    var js={"sponsor_id":sponsor_id};
    $.post(url+"loyalty/level2", js, function(data){
      $('#levelTwo').html(data.result);
      }, "json");
    });
</code></pre>
