0

So I am pulling content from a Discussion List in Sharepoint and dropping it in RTE text area on a new form. It all works well except that it puts all the content plus all the html tags in the text area and all I want is the text.

How can I remove the html tags without messing up the styling in the text area.

2 Answers 2

3
var html = '<div class="blue">This is blue text</div>';
$(html).text(); //will strip the html tags and return only the text.
Sign up to request clarification or add additional context in comments.

2 Comments

function CopyBodyToDescription(contentbody) { var systemDescriptionRTETextArea = $("textarea[Title='Description']"); //alert($(systemDescriptionRTETextArea).html()); $(systemDescriptionRTETextArea).text(contentbody); //alert($(systemDescriptionRTETextArea).text()); }// End Function
Thats my code to put the content into the RTE would would I implement your code
0

A html textarea does not recognize html tags. You would need a javascript plugin to do that.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.