Version 1 260 Multiple-Choice Questions with
Rationales, Multiple Correct Answers &
Detailed Explanations, Table of Contents |
Quiz Format | Rationales | High-Yield Focus
TABLE OF CONTENTS
1.HTML & HTML5 (Questions 1–50)
2.CSS & CSS3 (Questions 51–100)
3.JavaScript Fundamentals (Questions 101–140)
4.JavaScript DOM Manipulation & Events (Questions 141–170)
5.JavaScript ES6+ Features (Questions 171–200)
6.APIs, AJAX, Fetch, JSON (Questions 201–230)
7.Web Performance, Security, Accessibility, Responsive
Design (Questions 231–260)
HTML & HTML5 (Questions 1–50)
Question 1
Which HTML5 element is used to define navigation links?
A. <nav>
B. <header>
C. <footer>
D. <section>
Correct Answer: A
Rationale: <nav> defines navigation links. <header> (B) is for
,introductory content. <footer> (C) is for footer content. <section> (D)
defines a section of content.
Question 2 (Select all that apply)
Which of the following are semantic HTML5 elements? (Select all that
apply)
A. <article>
B. <div>
C. <aside>
D. <span>
E. <main>
Correct Answers: A, C, E
Rationale: <article>, <aside>, and <main> are semantic elements
(describe meaning). <div> (B) and <span> (D) are non-semantic (generic
containers).
Question 3
What is the correct HTML5 doctype declaration?
A. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
B. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
C. <!DOCTYPE html>
D. <?xml version="1.0" encoding="UTF-8"?>
Correct Answer: C
Rationale: The HTML5 doctype is <!DOCTYPE html>. The others are
for older HTML/XHTML versions.
Question 4
Which input type is used for entering a color in HTML5?
,A. <input type="color">
B. <input type="picker">
C. <input type="rgb">
D. <input type="hex">
Correct Answer: A
Rationale: type="color" opens a color picker. The other options are not
valid HTML5 input types.
Question 5
Which attribute makes an input field required in HTML5?
A. required
B. mandatory
C. validate
D. mustfill
Correct Answer: A
Rationale: The required attribute prevents form submission if the field is
empty. The others are not valid HTML5 attributes.
Question 6 (Select all that apply)
Which of the following are valid HTML5 input types? (Select all that
apply)
A. email
B. tel
C. number
D. range
E. slider
Correct Answers: A, B, C, D
Rationale: email, tel, number, and range are all valid HTML5 input
types. slider (E) is not valid (use range instead).
, Question 7
What does the <canvas> element do in HTML5?
A. Displays a pre-made image
B. Draws graphics dynamically using JavaScript
C. Plays video files
D. Displays SVG graphics
Correct Answer: B
Rationale: <canvas> provides a drawing surface that is manipulated with
JavaScript. It does not display static images (A) or directly play video
(C). SVG (D) is a different vector format.
Question 8
Which element is used to embed audio in HTML5?
A. <sound>
B. <audio>
C. <mp3>
D. <media>
Correct Answer: B
Rationale: <audio> is the correct HTML5 element for embedding sound
files. <source> can be nested inside to specify multiple formats.
Question 9
Which attribute of the <video> element makes it start playing
automatically?
A. play
B. autoplay
C. start
D. loop