- setTimeout (function, duration): The total setTimeout() function sets a timer which executes a function or specified piece of code after some delay or duration.
- clearTimeout (setTimeout_variable): The clearTimeout() function is used to clear the timer that has been set by the setTimeout().
- setInterval (function, duration): The setInterval() function sets a timer which repeatedly executes a function or piece of code according to the specified duration.
<div id =«container»>
Here is the snippet of the script code: