var str="123123";alert(str.replace("1","0")); //只替换第一处结果为023123alert(str.replace(/1/g,"0")); //替换全部结果为023023