Append Data in Current UL with id of LI
<p>i have following structure in html (due to formatting issues in posting questions i am not writing initial tag before ul and li)</p>

<pre><code>&lt;ul&gt;
    &lt;li id="list0"&gt;xyz
        &lt;ul&gt;
            &lt;li id="list1"&gt;abc&lt;/li&gt;
            &lt;li id="list2"&gt;abc&lt;/li&gt;
            &lt;li id="list3"&gt;abc&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>Now suppose i can pass id as list2 only to the function and that functions does some ajax stuff and give response li id="list4">abc

<p>i want to append this newly added child in ul having li with id "list2".
what will be the selector i tried following but failed</p>

<pre><code>function selectUl(id){
   $("#list"+id+"").parent().append('li id="list4"&gt;abc&lt;/li');  //inserts new list in parent ul 
   $("#list"+id+"").append('li id="list4"&gt;abc&lt;/li'); //inserts new list after current ul
   $('li id="list4"&gt;abc&lt;/li').insertAfter("#list"+id+""); //inserts new list after current ul
}
</code></pre>

<p>Now want to insert new list in current ul tell me now to do this provided that i can only pass id of list inside that ul.</p>
