2016-08-17 84 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

請給我一個方法,當網站加載後,功能。謝謝 –

相關問題