-
-
Save tedshd/1e3581a74c4f2be7a64f to your computer and use it in GitHub Desktop.
Trim html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trimHTMLTagContent(string) { | |
string = string.replace(/\n/g, ''); | |
string = string.replace(/\s\s/g, ''); | |
// remove two space | |
string = string.replace(/<font color.*?<\/font>/mig, ''); | |
// remove color font content | |
string = string.replace(/<[^>]*>/g, ''); | |
// remove html tag | |
console.log(string); | |
} | |
var str = document.querySelector('#NickContainer').innerHTML; | |
trimHTMLTagContent(str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment