Home > Article > Web Front-end > Summary of usage of JS Replace to replace all characters_javascript skills
script language="javascript">
var r= "1n2n3n";
//Change the letters
Replace semicolon
alert(r.replace("n",";"));
Result: 1;2n3n only replaced the first