---
title: "javascript 替换所有指定的字符"
author: "zwxiaole"
date: "2015-03-30T20:35:55Z"
tags: []
categories: ["Web前端"]
slug: "javascript"
draft: false
lastmod: "2015-03-30T20:35:55Z"
id: 2197191
url: "https://zwxiaole.iteye.com/blog/2197191"
---

function del\_html\_tags(str,reallyDo,replaceWith) { 

    var e=new RegExp(reallyDo,"g"); 

    words = str.replace(e, replaceWith); 

    return words; 

}