Strip HTML from Text JavaScript -


Is there an easy way to take a string of HTML in JavaScript and extract HTML?

If you're running in a browser, the easiest way is to just

function bar (html) {var tmp = document.createElement ("DIV"); Tmp.innerHTML = html; Return tmp.textcontent || Tmp.innerText || ""; }

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -