I have setup a div for the summernote to alter text pulled from a database.
Inspired by @user3367639, this is a more generic way to do it
$('.summernote').each(function () {
var $textArea = $(this);
$textArea.summernote({
onKeyup: function (e) {
$textArea.val($(this).code());
$textArea.change(); //To update any action binded on the control
}
});
});
And with this method :
String.prototype.strip = function()
{
var tmpDiv = document.createElement("div");
tmpDiv.innerHTML = this;
return tmpDiv.textContent || tmpDiv.innerText || "";
}
You could do in your JS controller something like this to get the text value of your textarea
$myTextArea.val().strip(); //Where val() returns the html and strip() returns the text
Hope this will help