-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExercise.html
More file actions
64 lines (40 loc) · 1.68 KB
/
Exercise.html
File metadata and controls
64 lines (40 loc) · 1.68 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
<!-- in this lesson: -->
<!-- ------------------- -->
<!--
Lesson 1 : Exercises - JavaScript Basics
!!! NOTE : Do these exercise in the console (right-click > inspect > Console)
🟨 visit this link for QuestionBank :-
🟩 https://github.com/deepk2891/Javascript/blob/main/lesson-01/README.md
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Exercises - JavaScript Basics</title>
</head>
<body>
<script>
// 🟨1a. Use alert(...); to display 'Good morning!' in a popup
alert("Good morning!");
// 🟨1b. Display your nam ein a popup.
alert("deepk2891");
// 🟨1c. Using math, calculate 10 + 5 in the Console.
10 + 5;
// 🟨1d. Calculate 20 - 5 in the Console.
20 - 5;
// 🟨1e. Calculate 2 + 2 - 5 in the Console.
2 + 2 - 5;
// 🟨1f. Use document.body.innerHTML=...; to display 'Good morning!' on the web page.
document.body.innerHTML = "Good morning!";
// 🟨1g. Display your name on the webpage.
document.body.innerHTML = "deepk2891";
// 🟨1h. You order T-shirt for $10, socks for $8 and dinner plates for $20. Use JavaScript to calculate the total cost of your order.
10 + 8 + 20;
// 🟨1i. Your bank account has $100, you spent $20 on lunch, $50 on dinner, and earn $200 from your job. Calculate how much money you have.
100 - 20 - 50 + 200;
// 🟨1j. Use document.body.innerHTML=...; to make the webpage blank.
document.body.innerHTML = "";
</script>
</body>
</html>