Let's say you need to display a message to your website visitors every 3 seconds. However, with the set interval method you can invoke them multiple times. How are they different? Well, setTimeout() calls functions once. The JS setInterval() function is similar to the setTimeout method. It could be defined simply as a method which allows you to invoke functions in set intervals. JavaScript interval to be set use setInterval() function. If you only need to execute a function one time, use the setTimeout() method.The JavaScript setInterval() method returns an ID which can be used by the clearInterval() method to stop the interval. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |