I am trying to take data from a textarea element to serve that as setData
to CKEDITOR
but instead of getting the HTML code I am getting the html code as a string, It's not being rendered as HTML code. Please have a look over the code :
CKEDITOR.replace('editor', {
height: 200
});
window.onload = function() {
var html = $('textarea[name="venue_description"]').text();
CKEDITOR.instances.editor.setData(html);
}
Here is the result what I am getting as :
Use val()
instead of text()
var html = $('textarea[name="venue_description"]').val();