Strip tag from text (in React JS)
问题 I have multiple whole html code in variable cleanHTML and i need to strip specific tags from text. let cleanHTML = document.documentElement.outerHTML this: <span class="remove-me">please</span> <span class="remove-me">me too</span> <span class="remove-me">and me</span> to this: please me too and me I´m trying to do it with: var list = cleanHTML.getElementsByClassName("remove-me"); var i; for (i = 0; i < list.length; i++) { list[i] = list[i].innerHTML; } But i´m getting error from React