我尝试从div替换一些文本,例如从控制台替换:
>"<br>* Please add email(s)!<br>* Please add email(s)!".replace(/<br>* Please add email(s)!/g,'')
结果:
<-"<br>* Please add email(s)!<br>* Please add email(s)!"
答案 0 :(得分:2)
将正则表达式修复为/<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,'')