I have a simple textarea with a button:
I change the content of the textarea with
$("button.test").click(function(){
$("#config_oh").contentEditable = true;
$("#config_oh").html("Hello World);
});
This works. But if I type inside the textarea and re-run the script, it doesn't work: The content is there (I can see it with Chrome inspector) but no content is displayed on the webpage. Why?
If I update the the content of the textarea
with val()
, it works, but no HTML rendering is performed, e.g. I see html special chars.