I am new to summernote text editor. I am trying to get the proper content from the summernote textarea, which infact coming with html tags. I tried
<textarea class="summernote" id="summernote" ng-model="blog.content" ></textarea>
in my html page and getting the textarea content with,
$("#summernote").code();
it is fetching the content in html tags. I want the content to be displayed without the html tags.
Thank you for the advice.
I am new to summernote text editor. I am trying to get the proper content from the summernote textarea, which infact coming with html tags. I tried
<textarea class="summernote" id="summernote" ng-model="blog.content" ></textarea>
in my html page and getting the textarea content with,
$("#summernote").code();
it is fetching the content in html tags. I want the content to be displayed without the html tags.
Thank you for the advice.
Share Improve this question asked Mar 27, 2015 at 14:32 Shweta MShweta M 1461 gold badge2 silver badges11 bronze badges5 Answers
Reset to default 4in laravel, simple use
{!! $product->small_description !!}
instread of {{! $product->small_description !}}
in blade file where you want to fetch the data
Use val() to get all what entered in textarea or text, So :
var content = $("#summernote").val()
Use $().text() method to get plain text.
$("<div />").html($("#summernote").code()).text();
After a long time of searching , thought instead of trying that in getting summernote text editor value with plain text, why not try with the angular filter. So searched and got the filter which exactly does what I needed.
Here is the link which did my job.
angularjs to output plain text instead of html
I had the same problem, "fixed" it by using version 0.6.16 instead of the current stable version 0.7. HTML is rendering fine now without extra js code.