I have the markup like that:
<div class="outer">
<a class="btn">
<img src="btnImg.jpg" />
</a>
Some Title
</div>
Now, I need to replace the text (Some Title thing) with a textbox that contains the current title. I've tried that:
$(".outer").append("<input value='"+$(".outer").text()+"'></input>");
$(".outer").text("");
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.