Wednesday, April 25, 2018

starts(Interval dynamically) and stop

<!DOCTYPE html>
<html>
<body>

<p>A script on this page starts(Interval dynamically) and stop</p>

<p id="demo"></p>
<input id="intervalValue"type="text">
<button onclick="myStartFunction()">Start</button>
<button onclick="myStopFunction()">Stop </button>

<script>

var myVar;
function myTimer() {
   for(var index=0;index<5;index++){
     console.log(index); 
}
 }
function myStopFunction() {
    clearInterval(myVar);
}
function myStartFunction(){
    var theIntervalValue =  document.getElementById("intervalValue");
myVar = setInterval(function(){ myTimer() }, theIntervalValue);
}
</script>

</body>
</html>

A script on this page starts(Interval dynamically) and stop

No comments:

Post a Comment

Recent Post

Databricks Delta table merge Example

here's some sample code that demonstrates a merge operation on a Delta table using PySpark:   from pyspark.sql import SparkSession # cre...