I need to be able to render some HTML tags inside a textarea (namely , , , ) but textareas only interpret their content as text. Is
try this example
function toggleRed() {
var text = $('.editable').text();
$('.editable').html('' + text + '
');
}
function toggleItalic() {
var text = $('.editable').text();
$('.editable').html("" + text + "");
}
$('.bold').click(function() {
toggleRed();
});
$('.italic').click(function() {
toggleItalic();
});
.editable {
width: 300px;
height: 200px;
border: 1px solid #ccc;
padding: 5px;
resize: both;
overflow: auto;
}