1.去除html标签
String.prototype.stripHTML = function(){
var reg = /<(?:.|\s)*?>/g;
return this.replace(reg,"");
};
var str = '<span alert="low" style="color:white;background-color:rgb(0,201,31);padding:5px;">123</span>';
console.log(str.stripHTML()); //outputs "123"