jquery .append() not working
<p>I am trying to append some text to the dynamically created div. I am doing this inside the .each() fucntion. The problem the text is not getting appended. Can someone please help me with this. Here it is what I am trying to do</p>

<pre><code>         $('&lt;div class="window" id="window'+i+'" /&gt;')
                .append($('&lt;p id="country'+i+'"&gt;').text($(this).find('COUNTRY').text()))
                .appendTo('body');
                var j = 0;
                $(this).find('TO').each(function(){
                    var $name = $(this).text();
                    alert("@@@@@@@@@@@@@@@@@@@@::::"+$name);
                    j +=1;
                    $('&lt;#id="window'+i+'" /&gt;').append($('&lt;p id="to'+j+'"&gt;Test&lt;/p&gt;'));
                });
</code></pre>

<p>Please help me by letting me know where I am going wrong with this</p>
