JavaScript Strip Tags

To get only Text from String with html tags.


function strip(html)
{
var tmp = document.createElement("DIV");
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText;
}


From: http://css-tricks.com/snippets/javascript/strip-html-tags-in-javascript/

Comments

Popular posts from this blog

How to simulate slow connection (developer proxy in Node.js)

How to use NPM packages from private repositories on bitbucket