-
Notifications
You must be signed in to change notification settings - Fork 0
/
HTMLExer.html
254 lines (246 loc) · 13.4 KB
/
HTMLExer.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<!DOCTYPE html>
<html lang="en">
<head>
<!-- ad sense tag-->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1733919132650092"
crossorigin="anonymous"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FBJL1SB5QM"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-FBJL1SB5QM');
</script>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description"
content="CodingNation provides exercises to pratice and learn coding. Coding Nation Execise are used to enhance your coding skills">
<meta name="keywords"
content="coding, programming, tutorial, learn, HTML, CSS, JavaScript, Python, resources, free, code tutorial, coding exercises, coding challenges, learn to code, coding skills">
<meta name="author" content="coding-nation">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="index, follow">
<link rel="icon" type="image/png" sizes="32x32" href="../images/favicon.png">
<title>HTML Exercise</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous" />
<link rel="stylesheet" href="../Styles/Exercise.css">
</head>
<body>
<!--navigation bar-->
<header class="fixed-navbar">
<!--navigation bar-->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="../index.html">CodingNation</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto" id="navbarNavLinks">
<li class="nav-item">
<a class="nav-link" href="../index.html">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
aria-controls="navbarNav" aria-expanded="false"
aria-label="Toggle navigation">Courses</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="../Python.html">Python</a>
</li>
<li>
<a class="dropdown-item" href="../React.html">React JS</a>
</li>
<li>
<a class="dropdown-item" href="../html.html">HTML</a>
</li>
<li><a class="dropdown-item" href="../css.html">CSS</a></li>
<li>
<a class="dropdown-item" href="../jascri.html">JavaScript</a>
</li>
<li><a class="dropdown-item" href="../cpro.html">C</a></li>
<li>
<a class="dropdown-item" href="../java.html">Java</a>
</li>
<li><a class="dropdown-item" href="../php.html">PHP</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button"
data-bs-toggle="dropdown">Practice</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="../HTMLQuiz.html" target="_blank">HTML Quiz</a>
</li>
<li>
<a class="dropdown-item" href="../CSSQuiz.html" target="_blank">CSS Quiz</a>
</li>
<li>
<a class="dropdown-item" href="../JSQuiz.html" target="_blank">JavaScript Quiz</a>
</li>
<li>
<a class="dropdown-item" href="../CQuiz.html" target="_blank">C Quiz</a>
</li>
<li>
<a class="dropdown-item" href="../JAVAQuiz.html" target="_blank">Java Quiz</a>
</li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button"
data-bs-toggle="dropdown">Exercises</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="../HTMLExer.html" target="_blank">HTML Exercise</a>
</li>
<li>
<a class="dropdown-item" href="../CSSExer.html" target="_blank">CSS Exercise</a>
</li>
<li>
<a class="dropdown-item" href="../JsExer.html" target="_blank">JavaScript
Exercise</a>
</li>
<li>
<a class="dropdown-item" href="../CExer.html" target="_blank">C Exercise</a>
</li>
<li>
<a class="dropdown-item" href="../JAVAExer.html" target="_blank">Java Exercise</a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="../codebot.html" target="_blank">CodeBot</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../Editor.html" target="_blank">Editor</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../About.html">About</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<h1 class="float-start">Exercise</h1>
<p id="title"></p>
<div class="questions" id="questions"></div>
<div class="bt">
<button type="submit" id="submit">Submit</button>
<button id="next">Next</button>
<button id="wrong">Try Again</button>
<button id="showAnswer">Show Answer</button>
</div>
</div>
<!-- Footer Section -->
<footer class="container-fluid text-center">
<hr />
<span class="bi bi-caret-up" onclick="topFunction()"></span>
<p>Copyright © 2023 CodingNation. All rights reserved. <br /></p>
<p>
Trademark ™ CodingNation
<a href="https://www.coding-nation.com/">www.coding-nation.com</a>
</p>
</footer>
<script>
const submit = document.getElementById("submit");
const next = document.getElementById("next");
const wrong = document.getElementById("wrong");
const questions = document.getElementById("questions");
const head = document.getElementById("title");
const showAnswer = document.getElementById("showAnswer");
const quiz = [
{
title: "Enter a Attribute that Used To Link",
question:
`<p><a <input type="text" maxlength="4"> "https://www.coding-nation.com">This is a
link</a></p>`,
answer: "href"
},
{
title: "Enter a Class to Paragraph Tag",
question:
`<p><p <input type="text" maxlength="5">
="demo">coding-nation is a web developer's site.</p>`,
answer: "class"
},
{
title: "Enter Attribute Used for Description/Alternate text of the Image",
question: `<p><img src="codingnation.png" <input type="text" maxlength="3">="codingnation Logo"></p>`,
answer: "alt",
},
{
title: "Add aLine break at the end of the paragraph",
question: `<p>Break Element<input type="text" maxlength="4"></p>`,
answer: "<br>",
},
{
title: "Use the correct HTML tag to add a paragraph with the text \"Hello World\"",
question: `<p><html><br><body><br><input style="width:180px;" type="text" maxlength="18"><br><br></body><br></html></p>`,
answer: "<p>Hello world</p>",
},
{
title: "Clean up this document with proper end tags.",
question: `<p><h1>This is Heading<input type="text" maxlength="5"></p>`,
answer: "</h1>",
},
{
title: "Add a horizontal rule between the heading and the paragraph.",
question: `<p style="margin-left:10px;"><h1>London</h1><br><input type="text" maxlength="5"><br><p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.<p/></p>`,
answer: "<hr>",
},
{
title: "Use the correct HTML attribute, and CSS, to set the color of the paragraph to \"blue\".",
question: `<p><p style="<input type="text" maxlength="5">">This is a paragraph.<p></p>`,
answer: "blue",
},
{
title: "Use the correct HTML attribute to display uppercase roman numbers.",
question: `<p><ol <input style="width:83px;" type="text" maxlength="10">><br>
<li>Coffee</li><br>
<li>Tea</li><br>
<li>Milk</li><br>
</ol></p>`,
answer: "type=\"I\"",
},
{
title: "Use the correct HTML attribute to display Capital Letters.",
question: `<p><ol <input style="width:83px;" type="text" maxlength="10">><br>
<li>Coffee</li><br>
<li>Tea</li><br>
<li>Milk</li><br>
</ol></p>`,
answer: "type=\"A\"",
},
{
title: "In the form below, add an input field for text, with the name \"username\" .",
question: `<p><form action="/action_page.php"><br><input style="width:260px;" type="text" maxlength="40"><br></form><br></p>`,
answer: "<input type=\"text\" name=\"username\">",
},
{
title:
'In the form below, add a submit button with the value "Submit Form".',
question: `<p><form action="/action_page.php"><br>
<input type=\"text\" name=\"username\"><br><input<input style="width:260px;" type="text" maxlength="40">><br></form><br></p>`,
answer: 'type="submit" value="submit form"',
},
{
title:
'In the input field below, add placeholder that says \Your name here".',
question: `<p><form action="/action_page.php"><br>
<input type=\"text\"<input style="width:300px;" type="text" maxlength="40">><br></form><br></p>`,
answer: 'Placeholder="Your name here"',
},
];
</script>
<script src="../Scripts&xml/Exercise.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
crossorigin="anonymous"></script>
</body>
</html>