工作中经常遇到网站中要更换一个字,但更新模板和修改太麻烦,下面只需要一段js就可以随意更改页面的某个字符。
document.body.innerHTML = document.body.innerHTML.replace(/替换的字/g, '替换后的字');
这样网页页面中所有‘替换的字’就被替换成‘替换后的字’,省时省力,特别适合页面临时改动。
If you are willing to cooperate, I hope to hear from you to discuss the opportunity for collaboration.
Here is my Email: t@29ym.com
Looking forward to connecting with you and embarking on this partnership together!
工作中经常遇到网站中要更换一个字,但更新模板和修改太麻烦,下面只需要一段js就可以随意更改页面的某个字符。
document.body.innerHTML = document.body.innerHTML.replace(/替换的字/g, '替换后的字');
这样网页页面中所有‘替换的字’就被替换成‘替换后的字’,省时省力,特别适合页面临时改动。