简体   繁体   English

JS替换不起作用

[英]JS replace doesn't work

I try to replace some text from div, example from console: 我尝试替换div中的一些文本,例如控制台中的示例:

>"<br>* Please add email(s)!<br>* Please add email(s)!".replace(/<br>* Please add email(s)!/g,'')

result: 结果:

<-"<br>* Please add email(s)!<br>* Please add email(s)!"

将正则表达式固定为/<br>\\* Please add email\\(s\\)!/g ,尝试:

"<br>* Please add email(s)!<br>* Please add email(s)!<br>* Please add email(s)!<br>* Please add email(s)!".replace(/<br>\* Please add email\(s\)!/g,'')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM