user2753240
user2753240

Reputation: 1

Removing HTML tags using JQuery from content pulled using JQuery

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.

Upvotes: 0

Views: 81

Answers (2)

slash197
slash197

Reputation: 9034

var html = '<div class="blue">This is blue text</div>';
$(html).text(); //will strip the html tags and return only the text.

Upvotes: 3

mhenke
mhenke

Reputation: 246

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

Upvotes: 0

Related Questions