-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlastpart.html
More file actions
79 lines (70 loc) · 1.78 KB
/
Copy pathlastpart.html
File metadata and controls
79 lines (70 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html>
<body>
<h1>The onclick Event</h1>
<table>
<thead>
<tr>
<th col-3>Machine</th>
<th col-4>Stopped</th>
<th col-2></th>
<th col-2>Current</th>
<th col-2>Speed</th>
</tr>
</thead>
<tbody>
<tr>
<td>Machine 1</td>
<td id="m1Status">Stopped</td>
<td></td>
<td>Current</td>
<td>Speed</td>
<td id="status">Stopped</td>
</tr>
<tr>
<td>Machine 2</td>
<td id="m2Status">Stopped</td>
<td></td>
<td>Current</td>
<td>Speed</td>
</tr>
<tr>
<td>Machine 3</td>
<td id="m3Status">Stopped</td>
<td></td>
<td>Current</td>
<td>Speed</td>
</tr>
</tbody>
</table>
<button onclick="myFunction()">Start</button>
<p id="demo"></p>
<script>
function myFunction() {
var tblMachines = document.getElementById("tblMachines")
var status = document.getElementById("status").innerHTML
var delay = 3
const delayMilliSeconds = ((delay*60)*1000);
// alert(milliseconds)
const generateRandomNumber = (min, max) => {
return Math.floor(Math.random() * (max - min) + min);
};
console.log(generateRandomNumber(100, 200))
console.log(generateRandomNumber(100, 200))
console.log(generateRandomNumber(100, 200))
if(Status = "Stopped"){
status = document.getElementById("status").innerHTML = "Started";
document.getElementById("m1Status").innerHTML = "Started";
setTimeout(function(){
document.getElementById("m2Status").innerHTML = "Started";
},1000);
// 1 min in milliseconds = 60000
// 3 mins in milliseconds = 180000
setTimeout(function(){
document.getElementById("m3Status").innerHTML = "Started";
},2000);
}
}
</script>
</body>
</html>