Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get text from html string

function extractContent(html) {
    return new DOMParser()
        .parseFromString(html, "text/html")
        .documentElement.textContent;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #text #html #string
ADD COMMENT
Topic
Name
1+1 =