Setting Timing Functions
setTimeout(FunctionName,Time);
Eg
<button onclick=”setTimeout(fff, 4000);”>Click for Hello</button>
<script>
function fff() {
alert(‘Hello’);
}
</script>
clearTimeout(VariableName);
<p>Click “Start”. Wait for 4 seconds, Alert “hello” will appear.</p>
<p>Click “Stop” before 4 seconds to stop the function started.</p>
<button onclick=”aaa = setTimeout(fff, 4000)”>Try it</button>
<button onclick=”clearTimeout(aaa)”>Stop it</button>
<script>
function myFunction() {
alert(“Hello”);
}
</script>