Remove all HTMLtags in a string (with the jquery text() function)

后端 未结 6 1902
不思量自难忘°
不思量自难忘° 2020-12-03 06:44

is it possible to use the jquery text() function to remove all HTML in a string?

String with HTML tags:
myContent = \'

6条回答
  •  时光取名叫无心
    2020-12-03 07:31

    I found in my specific case that I just needed to trim the content. Maybe not the answer asked in the question. But I thought I should add this answer anyway.

    $(myContent).text().trim()
    

提交回复
热议问题