去掉html标签: str.replace(/?[a-zA-Z]+[^><]*>/g,"")去掉标签里面的属性: str.replace(/<([a-zA-Z]+)\s*[^><]*>/g,"<$1>")上面方法复制进去就行了。