I have a link, when I click on it, it should select a div p tag contents and replace the p tag with text box and previously stored contents.
Now my code is removing the p tag and adding text box but it is removing text box immediately and inserting p tag. After user presses enter, I want ajax fn to be called.
This is what I tried,
<a href="" id="den">DEN</a>
<div id="test">
<p id="x">I am doing good</p>
</div>
$("#den").live("click", function () {
var con = $("#test >p#x").html();
$("#test > p#x").remove();
$("#test > p#x").append('<textarea type="text" value='+con+'></textarea>');
});
});