Part 1: Multiple Choice Questions (40 Points)
HTML5 is primarily used for:
- (a) Server-side scripting
- (b) Client-side scripting
- © Database management
- (d) Networking
Which tag is used to define the main content of a web page in HTML5?
- (a)
<div> - (b)
<main> - ©
<body> - (d)
<header>
- (a)
What does the
<!DOCTYPE html>declaration do in HTML5?- (a) It defines the version of HTML being used
- (b) It defines the character encoding for the document
- © It defines the styling rules for the document
- (d) It defines the scripting language being used
The
metatag is typically used for:- (a) Displaying images on the web page
- (b) Defining the character encoding for the document
- © Controlling the behavior of the web page
- (d) Storing data locally on the user’s device
Which attribute is used to specify that an email address should be clickable?
- (a)
href - (b)
email - ©
tel - (d)
mail
- (a)
To embed a video on a web page, you would use which tag?
- (a)
<video> - (b)
<audio> - ©
<source> - (d)
<track>
- (a)
What does the
<canvas>tag allow you to do in HTML5?- (a) Draw graphics on the screen
- (b) Create a database for the web page
- © Play audio on the web page
- (d) Handle server-side scripting
The
canvaselement is used for:- (a) Drawing graphics and animations
- (b) Playing audio and video
- © Storing and managing data
- (d) Controlling the page layout
Which attribute is used to specify the source of an audio file in HTML5?
- (a)
src - (b)
href - ©
data - (d)
type
- (a)
The
data-*attributes in HTML5 are used for:- (a) Defining metadata for the web page
- (b) Storing custom data in elements
- © Defining the character encoding for the document
- (d) Controlling the behavior of the web page
Part 2: Short Answer Questions (30 Points)
- Briefly explain the difference between HTML4 and HTML5.
- Describe the purpose of the
<meta>tag and give an example of how it might be used. - What is the role of the
<canvas>element, and how is it used in web development? - Explain the concept of semantic tags in HTML5 and provide an example.
- Discuss the use of the
data-*attributes in HTML5 and how they can enhance the functionality of a web page.
Part 3: Code Questions (30 Points)
- Write a HTML5 document that includes a title, meta description, and a main content area with a heading and paragraph.
- Create a HTML5 page that includes a video element with controls, specifying the video source and poster image.
- Using the
<canvas>element, write a script that draws a simple rectangle on the canvas. - Write a HTML5 document that includes an audio element, specifying the source file and setting autoplay to true.
- Add a
data-*attribute to a HTML5 element and demonstrate how it can be used to store and retrieve data within JavaScript.
This midterm exam is designed to assess your understanding of HTML5. Good luck!
