-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
137 lines (127 loc) · 5.39 KB
/
index.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>notNotion - Daily Quiz To Test JavaScript Knowledge</title>
<link rel="icon" type="image/x-icon" href="./images/favicon.ico">
<link rel="stylesheet" href="./style.css">
</head>
<body>
<main>
<section class="quiz">
<div class="heading">
<p class="title">JavaScript-Basics</p>
<p class="subtitle">Quiz To Test Your Basic JavaScript Knowledge</p>
</div>
<div class="result hide">
<p> </p>
<p class="reload">
<button onclick="document.location.reload(true)">Try Again?</button>
</p>
</div>
<form class="quiz-form">
<div class="question">
<p>1. What is the correct way to declare a variable in JavaScript?</p>
<div class="option">
<input type="radio" name="q1" value="A" checked>
<label for="">variable x;</label>
</div>
<div class="option">
<input type="radio" name="q1" value="B" >
<label for="">var x;</label>
</div>
<div class="option">
<input type="radio" name="q1" value="C" >
<label for="">x = variable;</label>
</div>
<div class="option">
<input type="radio" name="q1" value="D" >
<label for="">let x;</label>
</div>
</div>
<div class="question">
<p>2. Which of the following is a valid way to comment out a single line in JavaScript?</p>
<div class="option">
<input type="radio" name="q2" value="A" checked>
<label for="">// This is a comment</label>
</div>
<div class="option">
<input type="radio" name="q2" value="B" >
<label for="">/* This is a comment */</label>
</div>
<div class="option">
<input type="radio" name="q2" value="C" >
<label for=""># This is a comment</label>
</div>
<div class="option">
<input type="radio" name="q2" value="D" >
<label for="">** This is a comment **</label>
</div>
</div>
<div class="question">
<p>3.What does the typeof operator do in JavaScript?</p>
<div class="option">
<input type="radio" name="q3" value="A" checked>
<label for="">Checks if a variable is undefined</label>
</div>
<div class="option">
<input type="radio" name="q3" value="B" >
<label for="">Returns the data type of a variable</label>
</div>
<div class="option">
<input type="radio" name="q3" value="C" >
<label for="">Converts a value to a string</label>
</div>
<div class="option">
<input type="radio" name="q3" value="D" >
<label for="">Checks if a variable is null</label>
</div>
</div>
<div class="question">
<p>4.What is the correct syntax for an if statement in JavaScript?</p>
<div class="option">
<input type="radio" name="q4" value="A" checked>
<label for="">if (condition) { // code to execute }</label>
</div>
<div class="option">
<input type="radio" name="q4" value="B" >
<label for="">if (condition) // code to execute</label>
</div>
<div class="option">
<input type="radio" name="q4" value="C" >
<label for="">if (condition) { code to execute }</label>
</div>
<div class="option">
<input type="radio" name="q4" value="D" >
<label for="">if condition { // code to execute }</label>
</div>
</div>
<div class="question">
<p>5. Which of the following methods is used to add a new element to the end of an array in JavaScript?</p>
<div class="option">
<input type="radio" name="q5" value="A" checked>
<label for="">append()</label>
</div>
<div class="option">
<input type="radio" name="q5" value="B" >
<label for="">push()</label>
</div>
<div class="option">
<input type="radio" name="q5" value="C" >
<label for="">add()</label>
</div>
<div class="option">
<input type="radio" name="q5" value="D" >
<label for="">concat()</label>
</div>
</div>
<div class="submit">
<input type="submit" value="Submit">
</div>
</form>
</section>
</main>
<script src="./index.js"></script>
</body>
</html>