문제

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.

도움이 되었습니까?

해결책 2

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

다른 팁

you can use outerHTML property to get "tag source"

for simple input with id="inputId" you will get "<input type="text" id="inputId">"

in your case try

var text = $('#myTextarea')[0].outerHTML
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top