-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmilestone1.html
99 lines (82 loc) · 2.29 KB
/
milestone1.html
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: green;
}
h2 {
font-family: Impact;
}
body {
text-align: center;
}
</style>
</head>
<body>
<h1>JAVASCRIPT PROGRAM</h1>
<p>
javascript program to genarate random integer between 1 to 10, the user is then prompted to input a guess
number. If the user input matches with guess number, the program will display a message "Matched" otherwise
display a message "Not matched"
</p>
<script type="text/javascript">
const num = Math.ceil(Math.random() * 10);
console.log(num);
const gnum = prompt('Guess the number between 1 and 10 inclusive');
if (gnum == num)
document.write("good work")
else
document.write("Not matched")
</script>
<h2> Display variables</h2>
<p id="demo"></p>
<script>
var x = 5;
var y = 6;
var z = x + y;
document.getElementById("demo").innerHTML = "The value of z is: " + z;
</script>
<p><mark style="background-color:burlywood">TOPIC:JAVA CORE</mark></p>
<h1>JAVASCRIPT</h1>
<h2>
JavaScript: Program to
get the website URL ?
</h2>
<p>
<b>
Click on Below Button
To Get Current URL
</b>
</p>
<button onclick="GetURL()"> Get URL </button>
<p id="url"></p>
<script>
function GetURL() {
var gfg = document.URL;
document.getElementById("url").innerHTML = gfg;
}
</script>
<h2>The javascript typeof</h2>
<p id="kk"></p>
<script>
document.getElementById("kk").innerHTML =
typeof "john" + "<br>" +
typeof 3.14 + "<br>" +
typeof true + "<br>" +
typeof false + "<br>" +
typeof x;
</script>
<p style="color:green">AREA F THE CIRCLE</p>
<script>
let pi = 3.14159265358979323846;
function findArea(r) {
return (pi * r * r);
}
let r, Area;
r = 5;
Area = findArea(r);
document.write("Area of Circle is :" + Area);
</script>
</body>
</html>