Javascript function that convert HTML to plain text
// converts HTML to text using Javascript | |
function html2text(html) { | |
var tag = document.createElement('div'); | |
tag.innerHTML = html; | |
return tag.innerText; | |
} |
This comment has been minimized.
This comment has been minimized.
This code is having XSS security issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.