1
내 웹 사이트에는 많은 페이지와 콘텐츠가 있습니다. 이제 웹 사이트가로드 될 때 모든 페이지에서 한 단어를 대체하고 싶습니다.웹 사이트가로드 될 때 모든 페이지에서 한 단어를 바꾸고 싶습니다.
내 웹 사이트에는 많은 페이지와 콘텐츠가 있습니다. 이제 웹 사이트가로드 될 때 모든 페이지에서 한 단어를 대체하고 싶습니다.웹 사이트가로드 될 때 모든 페이지에서 한 단어를 바꾸고 싶습니다.
timer = setInterval(myFunction,100);
function myFunction() {
var str = document.getElementById("demo").innerHTML;
var res = str.replace("hello", "hi");
document.getElementById("demo").innerHTML = res;
}
<p>Click the button to replace "hello" with "hello" in the paragraph below:</p>
<p id="demo">Visit hello!</p>
나에게 방법을 제공하십시오 , 웹 사이트가로드 된 후 작동합니다. 감사 –
은 참조 [이] (http://stackoverflow.com/questions/5558613/javascript-replace-text-in-the-html-body) – Aakash