2016-08-17 7 views

답변

0

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>

+0

나에게 방법을 제공하십시오 , 웹 사이트가로드 된 후 작동합니다. 감사 –