13
13
14
14
< div id ="distanceContainer " style ="text-align: center; ">
15
15
< div class ="container ">
16
- < div class ="speedCalculator ">
17
- < h1 > Distance Calculator</ h1 >
18
- < p > Distance is the measurement of actual path covered byy any object.</ p >
19
- < br >
20
- < p > Distance is the product of speed of an object to the time taken.
21
- </ p >
22
- < h3 class ="formula "> Distance = Speed * Time
23
- </ h3 >
24
- < h4 > SI unit of Distance is metre(m).</ h4 >
25
- < br >
26
- < h3 > < em > Fill in the speed(in m/s) and time(in seconds) and calculate the Distance. </ em > </ h3 >
27
-
28
- < input type ="number " id ="speed " placeholder ="Enter the Speed(in m/s) "
29
- > < br > < br >
30
- < input type ="number " id ="time " placeholder ="Enter the time(in seconds) "
31
- > < br > < br >
32
- < input type ="button " value ="distance " id ="speed " onclick ="calcDistance() ">
33
- < h3 id ="calculatedDistanceDisplay "> </ h3 >
34
- </ div >
35
-
36
- </ div >
37
- < script >
38
-
39
- function calcDistance ( ) {
40
- let speed = document . getElementById ( "speed" ) . value ;
41
- let time = document . getElementById ( "time" ) . value ;
42
- let calculatedSpeedDisplay = document . getElementById ( "calculatedSpeedDisplay" ) ;
43
- let distance = speed * time ;
44
- calculatedDistanceDisplay . innerText = `The calculated distance is ${ distance } metres.` ;
45
- }
46
-
47
-
48
-
49
- </ script >
16
+ < div class ="speedCalculator ">
17
+ < h1 > Distance Calculator</ h1 >
18
+ < p > Distance is the measurement of actual path covered byy any object.</ p >
19
+ < br >
20
+ < p > Distance is the product of speed of an object to the time taken.
21
+ </ p >
22
+ < h3 class ="formula "> Distance = Speed * Time
23
+ </ h3 >
24
+ < h4 > SI unit of Distance is metre(m).</ h4 >
25
+ < br >
26
+ < h3 > < em > Fill in the speed(in m/s) and time(in seconds) and calculate the Distance. </ em > </ h3 >
27
+
28
+ < input type ="number " id ="speed " placeholder ="Enter the Speed(in m/s) "> < br > < br >
29
+ < input type ="number " id ="time " placeholder ="Enter the time(in seconds) "> < br > < br >
30
+ < input type ="button " value ="distance " id ="speed " onclick ="calcDistance() ">
31
+ < h3 id ="calculatedDistanceDisplay "> </ h3 >
32
+ </ div >
33
+ < button class ="backButton "> < a href ="index.html "> Back</ a > </ button >
34
+ </ div >
35
+ < script >
36
+
37
+ function calcDistance ( ) {
38
+ let speed = document . getElementById ( "speed" ) . value ;
39
+ let time = document . getElementById ( "time" ) . value ;
40
+ let calculatedSpeedDisplay = document . getElementById ( "calculatedSpeedDisplay" ) ;
41
+ let distance = speed * time ;
42
+ calculatedDistanceDisplay . innerText = `The calculated distance is ${ distance } metres.` ;
43
+ }
44
+
45
+
46
+
47
+ </ script >
50
48
</ body >
51
49
52
50
</ html >
0 commit comments