Reputation: 1889
hello i have the following script : http://jsfiddle.net/EFjcA/
i would like my function :
var saveEdit = function(event2){
var btn = event2.target,
li = btn.parentNode,
p = li.getElementsByClassName('paratext')[0],
te = p.parentNode;
te.style.display="none";
p.appendChild(te.value);
p.style.display="block";
btn.innerText = "Edit";
btn.onclick = makeAreaEditable;
};
..to save the value from inside the textarea and display it after the button Ok is pressed.
Upvotes: 0
Views: 79
Reputation: 1317
Please replace the line
p.appendChild(te.value);
into
p.innerText = te.value;
li.appendChild(p);
Upvotes: 1