If your using JavaScript in a browser it can be as simple as this:
function strip(html) { var tmp = document.createElement("DIV"); tmp.innerHTML = html; return tmp.textContent||tmp.innerText; }
source: http://stackoverflow.com/questions/822452/strip-html-from-text-javascript