Search code examples
javascriptpythondjangosummernote

Set values in summer note text editor using JavaScript


I want to set dynamic values in the summer note text editor using JavaScript/jQuery. I have tried to set value with both but nothing works for me.

document.getElementById('summernote').innerHTML = data.message;


$('.summernote').summernote('code', data.message);

Can anyone help me with how I can add values in summer note using JavaScript/jQuery?


Solution

  • I got my Answer. I am fetching with summernote class not with ID.

    $("#summernote").summernote('code', data.message);