Chapter Two
1. The main role of HTML in web development is best explained by which concept?
a) Styling web pages
b) Structuring web content
c) Adding interactivity
d) Managing databases
2. HTML is best described by which concept?
a) Programming language
b) Markup language
c) Scripting language
d) Query language
3. The importance of HTML tags is best explained by which concept?
a) They define content structure
b) They execute logic
c) They store data
d) They apply styles
4. The relationship between an HTML tag and an HTML element is best explained by which
concept?
a) They are identical
b) An element includes tag and content
c) Tags contain attributes only
d) Elements are optional
5. The purpose of attributes in HTML is best explained by which concept?
a) They change program flow
b) They provide extra information about elements
c) They link CSS files
d) They store user data
6. The use of headings (<h1>–<h6>) is best explained by which concept?
a) Styling text
b) Structuring document hierarchy
c) Creating links
d) Displaying images
7. The concept behind hyperlinks in HTML is best explained as:
a) Styling navigation
b) Connecting web resources
c) Executing scripts
d) Storing URLs
8. The purpose of lists in HTML is best explained by which concept?
a) Data storage
b) Content organization
c) Page layout
d) User input
9. The concept behind HTML tables is best explained as:
a) Page decoration
b) Organizing data in rows and columns
c) Creating layouts only
d) Styling content
10. The main purpose of forms in HTML is best explained by which concept?
a) Page styling
b) Collecting user input
c) Displaying data
d) Structuring text
11. HTML form input fields are best explained by which concept?
a) Data processing
b) User interaction
c) Page layout
d) File storage
12. The importance of semantic HTML is best explained by which concept?
a) Improving code readability and accessibility
b) Increasing execution speed
c) Styling content
d) Storing data
13. The difference between block and inline elements is best explained by which concept?
a) Execution order
b) Layout behavior
c) Data storage
d) Styling priority
14. The role of the <img> element is best explained by which concept?
a) Linking documents
b) Embedding image resources
c) Styling backgrounds
d) Creating icons
15. The importance of the alt attribute in images is best explained by which concept?
a) Image decoration
b) Accessibility and fallback text
c) Page layout
d) Image storage
16. Nesting elements in HTML is best explained by which concept?
a) Code execution
b) Hierarchical structure
c) Styling inheritance
d) Script control
17. The overall structure of an HTML document is best explained by which concept?
a) Programming logic
b) Document structure model
c) Database design
d) Styling framework
18. HTML files can be opened directly in a browser because of which concept?
a) Compilation
b) Interpretation by browsers
c) Server execution
d) Database support
19. The separation of HTML and CSS is best explained by which concept?
a) Code duplication
b) Separation of content and presentation
c) Execution speed
d) Data security
20. The reason HTML is essential in web development is best explained by which concept?
a) It manages databases
b) It provides the foundation of web pages
c) It executes algorithms
d) It replaces CSS and JavaScript
True or False
1. HTML is a programming language.
2. HTML is used to structure web content.
3. HTML tags must always have closing tags.
4. Attributes provide additional information about elements.
5. <head> contains visible page content.
6. <body> contains the main visible content.
7. HTML supports images, links, and tables.
8. Forms are used to collect user input.
9. <ol> represents an unordered list.
10. HTML is case-sensitive.
11. Hyperlinks connect web pages together.
12. Tables are used to display data in rows and columns.
13. HTML alone can make a webpage interactive.
14. Images cannot be displayed without HTML.
15. HTML is essential for web development.
Chapter three
1. The main purpose of CSS in web development is best explained by which concept?
a) Structuring web content
b) Adding interactivity
c) Styling and designing web pages
d) Creating databases
2. CSS stands for which concept?
a) Creative Style Sheets
b) Cascading Style Sheets
c) Computer Style Sheets
d) Colorful Style Sheets
3. The concept of “selector” in CSS is best explained as:
a) A rule to apply styles to HTML elements
b) A type of HTML element
c) A browser feature
d) A database query
4. The concept of a “declaration block” is best explained as:
a) HTML content container
b) CSS rules enclosed in {} with property and value
c) JavaScript function
d) HTML attribute
5. The purpose of the color property is best explained by which concept?
a) Changes text size
b) Changes text color
c) Changes background color
d) Changes layout
6. The purpose of the background-color property is best explained as:
a) Styling text
b) Coloring the background of an element
c) Changing font type
d) Aligning content
7. The purpose of font-size property is best explained by which concept?
a) Controlling the size of text
b) Controlling line spacing
c) Adding margins
d) Changing colors
8. The concept behind class selectors (.classname) is:
a) Select unique elements
b) Select elements with the same class
c) Apply inline style
d) Control JavaScript events
9. The concept behind ID selectors (#idname) is:
a) Select multiple elements
b) Select a single unique element
c) Apply multiple styles
d) Create new HTML elements
10. The universal selector (*) in CSS is best explained as:
a) Applies styles to all elements
b) Selects one element
c) Controls layout only
d) Creates new elements
11. The purpose of margin in CSS is best explained by which concept?
a) Space inside the element
b) Space outside the element
c) Text styling
d) Table styling
12. The purpose of padding in CSS is best explained by which concept?
a) Space inside the element
b) Space outside the element
c) Background styling
d) Table alignment
13. The purpose of display property is best explained as:
a) Controls how an element is displayed on a page
b) Sets text color
c) Sets margin
d) Controls font size
14. The concept behind position property is:
a) Aligns text
b) Controls element placement
c) Changes colors
d) Styles lists
15. The concept behind absolute units in CSS is:
a) Relative to parent element
b) Fixed measurement units like px, cm, in
c) Percent-based units
d) Dynamic units for responsive design
16. The concept behind relative units in CSS is:
a) Fixed size units
b) Units based on screen or parent element (%, em, rem)
c) Pixel-specific units
d) Background spacing
17. The purpose of z-index is best explained by which concept?
a) Controls text color
b) Controls layering order of elements
c) Controls font size
d) Controls padding
18. The purpose of list-style-type is best explained by which concept?
a) Adds borders to lists
b) Defines the type of bullets or numbers in lists
c) Controls spacing in lists
d) Styles table rows
19. The concept behind inline CSS is:
a) Written in a separate file
b) Written directly in HTML tag with style attribute
c) Written inside <style> tag in <head>
d) Written in JavaScript
20. The concept behind external CSS is:
a) Written inside HTML tag
b) Written in a separate .css file and linked to HTML
c) Written in <style> tag
d) Written in JavaScript
True or false
1. CSS is used to style and format web pages.
2. Inline CSS has the lowest priority.
3. External CSS is written inside <style> tags in HTML.
4. Class selectors can be used on multiple elements.
5. ID selectors can be used on multiple elements.
6. Padding is the space inside an element between content and border.
7. Margin is the space outside an element between its border and other elements.
8. CSS is case-sensitive.
9. display:none hides an element completely and removes its space.
10. visibility:hidden hides an element but keeps its space.
11. CSS can style HTML tables.
12. Font properties such as font-family and color are inherited by child elements.
13. Background color is inherited by default.
14. CSS improves website maintainability.
15. z-index only works on positioned elements (relative, absolute, fixed, sticky).
Chapter Four
Choice
The main purpose of JavaScript in web development is best explained by which concept?
a) Structuring web pages
b) Styling web pages
c) Adding interactivity and dynamic behavior
d) Creating databases
2. JavaScript is best described by which concept?
a) Markup language
b) Styling language
c) Programming/scripting language
d) Query language
3. The concept behind declaring variables in JavaScript is best explained as:
a) A container for storing data values
b) A type of HTML element
c) A CSS property
d) A function
4. The difference between var, let, and const is best explained by which concept?
a) Scope and mutability
b) Execution order
c) Text formatting
d) Array methods
5. The concept of data types in JavaScript is best explained as:
a) Labels for variables
b) Classification of values a variable can hold
c) Styling the webpage
d) Controlling loops
6. Type conversion in JavaScript is best explained by which concept?
a) Changing data types explicitly or implicitly
b) Declaring variables
c) Accessing DOM elements
d) Styling HTML elements
7. The difference between == and === is best explained by which concept?
a) Syntax error
b) Type coercion and strict equality
c) Loop control
d) Styling differences
8. Arithmetic and logical operators in JavaScript are best explained by which concept?
a) Styling elements
b) Performing mathematical and logical operations
c) Selecting DOM elements
d) Form validation
9. The concept of pre-increment (++x) and post-increment (x++) is best explained as:
a) Variable initialization
b) Incrementing values before or after evaluation
c) Function calls
d) Array manipulation
10. Conditional statements (if, else, switch) are best explained by which concept?
a) Repeating code
b) Making decisions based on conditions
c) Declaring arrays
d) Styling elements
11. Loops (for, while, do…while) are best explained by which concept?
a) Executing code repeatedly based on a condition
b) Declaring variables
c) Styling text
d) Handling events
12. Arrays in JavaScript are best explained by which concept?
a) Single value storage
b) Ordered collection of values
c) Styling elements
d) Event handling
13. The difference between slice() and splice() is best explained as:
a) Slice modifies the original array, splice does not
b) Slice copies a portion, splice can remove/insert elements
c) Both create new arrays only
d) Both delete arrays permanently
14. The concept behind concat() is best explained as:
a) Modifying an array in place
b) Merging arrays into a new array
c) Deleting array elements
d) Sorting array
15. Functions in JavaScript are best explained by which concept?
a) Reusable blocks of code
b) Styling blocks
c) Looping statements
d) Conditional logic
16. Arrow functions are best explained by which concept?
a) Shorter syntax for functions
b) Array operations
c) Conditional statements
d) Loop controls
17. Immediately Invoked Function Expressions (IIFE) are best explained by which concept?
a) Functions executed immediately after definition
b) DOM manipulation
c) CSS styling
d) Variable declaration
18. Callback functions are best explained by which concept?
a) Functions passed as arguments to other functions
b) Array methods only
c) Conditional statements
d) Looping functions
19. The DOM is best explained by which concept?
a) Object model representing HTML document structure
b) JavaScript data type
c) CSS property
d) Array type
20. Events in JavaScript are best explained by which concept?
a) Browser errors
b) User or browser actions that trigger code execution
c) Styling changes
d) HTML element attributes
True Or False
Questions:
1. JavaScript is a client-side scripting language.
2. JavaScript is used to structure the content of web pages.
3. The [Link]() function is used to display messages to the browser console.
4. The prompt() function is used to get input from the user.
5. Variables must always be declared before use in JavaScript.
6. var, let, and const all declare variables in JavaScript.
7. JavaScript arrays can only store elements of the same data type.
8. JavaScript supports loops for repeating code execution.
9. The if statement is used for looping through arrays.
10. Functions improve code reusability in JavaScript.
11. The DOM allows JavaScript to manipulate HTML elements dynamically.
12. Events in JavaScript respond to user actions like clicks and key presses.
13. The BOM (Browser Object Model) only controls HTML elements.
14. [Link]() output is visible to users on the webpage directly.
15. JavaScript can be used to validate HTML forms on the client side.
ANSWERS
Chapter Two: HTML
1. b) Structuring web content
2. b) Markup language
3. a) They define content structure
4. b) An element includes tag and content
5. b) They provide extra information about elements
6. b) Structuring document hierarchy
7. b) Connecting web resources
8. b) Content organization
9. b) Organizing data in rows and columns
10. b) Collecting user input
11. b) User interaction
12. a) Improving code readability and accessibility
13. b) Layout behavior
14. b) Embedding image resources
15. b) Accessibility and fallback text
16. b) Hierarchical structure
17. b) Document structure model
18. b) Interpretation by browsers
19. b) Separation of content and presentation
20. b) It provides the foundation of web pages
True or False
Answers:
1. False
2. True
3. False
4. True
5. False
6. True
7. True
8. True
9. False
10. False
11. True
12. True
13. False
14. True
15. True
Chapter Three: CSS
1. c) Styling and designing web pages
2. b) Cascading Style Sheets
3. a) A rule to apply styles to HTML elements
4. b) CSS rules enclosed in {} with property and value
5. b) Changes text color
6. b) Coloring the background of an element
7. a) Controlling the size of text
8. b) Select elements with the same class
9. b) Select a single unique element
10. a) Applies styles to all elements
11. b) Space outside the element
12. a) Space inside the element
13. a) Controls how an element is displayed on a page
14. b) Controls element placement
15. b) Fixed measurement units like px, cm, in
16. b) Units based on screen or parent element (%, em, rem)
17. b) Controls layering order of elements
18. b) Defines the type of bullets or numbers in lists
19. b) Written directly in HTML tag with style attribute
20. b) Written in a separate .css file and linked to HTML
True or False
Answers:
1. True
2. False
3. False
4. True
5. False
6. True
7. True
8. False
9. True
10. True
11. True
12. True
13. False
14. True
15. True
Chapter Four: JavaScript
1. c) Adding interactivity and dynamic behavior
2. c) Programming/scripting language
3. a) A container for storing data values
4. a) Scope and mutability
5. b) Classification of values a variable can hold
6. a) Changing data types explicitly or implicitly
7. b) Type coercion and strict equality
8. b) Performing mathematical and logical operations
9. b) Incrementing values before or after evaluation
10. b) Making decisions based on conditions
11. a) Executing code repeatedly based on a condition
12. b) Ordered collection of values
13. b) Slice copies a portion, splice can remove/insert elements
14. b) Merging arrays into a new array
15. a) Reusable blocks of code
16. a) Shorter syntax for functions
17. a) Functions executed immediately after definition
18. a) Functions passed as arguments to other functions
19. a) Object model representing HTML document structure
20. b) User or browser actions that trigger code execution
True Or False
Answers:
1. True
2. False
3. True
4. True
5. True
6. True
7. False
8. True
9. False
10. True
11. True
12. True
13. False
14. False
15. True