So I basically have this input field that popups once text is clicked. And I want the text that I type in the input field to replace the original text, seems simple enough but I'm lost here...
JQuery:
$('.profile-brief').click(function () {
$(this).click(function (e) {
var statusBio = $('#status').val();
$(this).replaceWith('<form><input id="status" type="text"></input></form>');
if (e.keyCode == 13) {
console.log(statusBio);
$(this).html('<form><input id="status" type="text">' + statusBio + '</input></form>');
}
});
});
Here's the http://jsfiddle.net/0beocw0o/