将settimeout添加到这些脚本

时间:2017-09-07 15:02:54

标签: javascript jquery ajax

有人可以将settimeout添加到这些脚本

<script>
document.getElementById("myDIV").innerHTML = "How are you?";
</script>

谢谢

1 个答案:

答案 0 :(得分:-1)

使用setTimeout功能:

setTimeout(function() {                          
       // .. your code here
}, 1000);

值1000以毫秒为单位,即1秒。

<script>
    setTimeout(function() {
      document.getElementById("myDIV").innerHTML = "How are you?";
    }, 1000);
</script>