settimeout用法app合集

settimeout用法app合集

setTimeout() 方法会返回某个值。在上面的语句中,值被储存在名为 t 的变量中。假如你希望取消这个 setTimeout(),你可以使用这个变量名来指定它。 setTimeout() 的第一个参数是含有 JavaScript 语句的字符串。这个语句可能诸如 alert(5 seconds!),或者对函数的调用,诸如 alertMsg()。

热门合集