var body = "<img style='adfs' class='container'>test</img></b>";
var result = body.replace(/img/gi,'like');
console.log(result);//<like style='adfs' class='container'>test</like></b>
js方法加正则 替换标签
最新推荐文章于 2023-08-18 16:58:33 发布
var body = "<img style='adfs' class='container'>test</img></b>";
var result = body.replace(/img/gi,'like');
console.log(result);//<like style='adfs' class='container'>test</like></b>