replace text with input
<p>I have the markup like that:</p>

<pre><code>&lt;div class="outer"&gt;
  &lt;a class="btn"&gt;
   &lt;img src="btnImg.jpg" /&gt;
  &lt;/a&gt;
  Some Title
&lt;/div&gt;
</code></pre>

<p>Now, I need to replace the text (<strong>Some Title</strong> thing) with a textbox that contains the current title. 
I've tried that:</p>

<pre><code>$(".outer").append("&lt;input value='"+$(".outer").text()+"'&gt;&lt;/input&gt;");
$(".outer").text("");
</code></pre>

<p>It puts a textbox with an empty string. I tried to store the text in a temporary variable, I tried to clone the entire outer div and then get the text, and empty the text in the original div. Anyway whatever I do, after I clear the text, input value also becomes empty.</p>
