开发者

Replace text using jquery

I need to replace a text within div that says "Please wait..." with "Ok.Its 开发者_Python百科done." after a random delay.Please help.Thanks in advance.


Try this:

$("#foo").text("Please Wait...")
         .delay(Math.random() * 1000) // between 0 and 1000 milliseconds
         .queue(function(q){
             $(this).text("okay, it's done");
             q();
         });


<script type="text/javascript"> 
window.onload = function () { 
  setTimeout(function () { 
    var div = document.getElementById('yourDiv'); 
    div.innerHTML = "OK. It's done.";  
  }, 10000); 
} 
</script> 


in jQuery, it would be:

$("myDiv").html("new content");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜