javascripthtmlhtmltext

Javascript: Get the value with the html tags from the textarea as with tinyMCE


When I am using TinyMCE, the value I am geting from is in HTML, also with HTML tags. Is there a possibility to get the same from a textarea?

When I am trying

var text= $('#myTextarea').val();

I am geting only the simple text, without html tags.

Thank you for your help.


Solution

  • It seems than the text and textarea are returning only plain text, and no html. We need to use tinyMCE in this case.