Modify a subset of html and append it with jquery
<p>I will try to explain my question with a simpliefied version of the code I will leave out the ajax stuff. </p>

<p>What I want to do is retrieve a form via ajax modify some values and append it. This should be pretty easy but I just do not get it to work.</p>

<p>My code is...</p>

<pre><code>    &lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Test Jquery&lt;/title&gt;
    &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        $(document).ready(function(){
            var str = "&lt;div&gt;&lt;form&gt;&lt;textarea&gt;&lt;/textarea&gt;&lt;/form&gt;&lt;/div&gt;"
            $('a#action').on('click',function(e){
                e.preventDefault();
                var result = str;
                var test = $("textarea",result).html("Hello world");

                console.log(test);
                console.log(result);
                $(".sections").append(result);
            });
        });
    &lt;/script&gt;​​​​​​
&lt;/head&gt;
&lt;body&gt;
&lt;div id="content"&gt;
    &lt;a href="#" id="action"&gt;go action&lt;/a&gt;
&lt;div class="sections"&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;#
</code></pre>

<p>The variable <code>str</code> should simulate the downloaded form from the server...
on click I want to change the </p>

<blockquote>
  <p>value</p>
</blockquote>

<p>of the <code>textarea</code> and insert <code>"Hello World"</code>...</p>

<p>What I would like to see is my str variable modified and appended to the sections div...</p>

<p>I can modify the textarea within a subset</p>

<pre><code>$("textarea",result).html("Hello world");
</code></pre>

<p>But I do not know how to reflect it to the whole result...</p>

<p>Like I said this is a trivial abstraction so <code>str</code> can differ...</p>
