wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

HTML Quiz

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

Which of the following is a self-closing tag in HTML?

a)

<div>

b)

<p>

c)

<img>

d)

<section>

2.

Which HTML5 element is used to specify a header for a document or section?

a)

<h1>

b)

<header>

c)

<section>

d)

<footer>

3.

What does the `data-*` attribute in HTML5 do?

a)

Stores custom data private to the page or application

b)

Links to a database

c)

Creates a form field

d)

Defines a data type

4.

Which of the following HTML elements is used to define emphasized text?

a)

<strong>

b)

<em>

c)

<b>

d)

<i>

5.

Which HTML element is used to define important text?

a)

<em>

b)

<strong>

c)

<b>

d)
  • <mark>

6.

How do you create a multi-line text input field in HTML?

a)

<textarea>

b)

<input type="text" multiline>

c)

<input type="textarea">

d)

<text>

7.

Which attribute is used to define inline styles in an HTML element?

a)

class

b)

style

c)

id

d)

inline

8.

Which of the following is not a valid HTML5 input type?

a)

color

b)

date

c)

email

d)

range

9.

Which tag is used to define a standard cell in an HTML table?

a)

<th>

b)

<td>

c)

<tr>

d)

<table>

10.

Which attribute in the `` tag is used to send form data to a server?

a)

method

b)

action

c)

enctype

d)

target

11.

What is the correct way to comment out text in HTML?

a)

<!-- Comment -->

b)

// Comment

c)

/* Comment */

d)

# Comment

12.

Which element is used to define the title of a document, which appears on the browser tab?

a)

<head>

b)

<meta>

c)

<title>

d)

<link>

13.

What does the `target="_blank"` attribute do in an anchor tag?

a)

Opens the link in a new window or tab

b)

Opens the link in the same window

c)

Displays the link in a blank page

d)

Refreshes the current page

14.

Which element is used to group elements for styling purposes in HTML?

a)

<section>

b)

<div>

c)

<span>

d)

<article>

15.

Which tag is used to define a drop-down list in an HTML form?

a)

<input>

b)

<select>

c)

<textarea>

d)

<button>

16.

How do you specify that an input field must be filled out before submitting the form?

a)

mandatory

b)

validate

c)

required

d)

needed

17.

Which tag is used to define a clickable button in an HTML form?

a)

<input type="button">

b)

<input type="submit">

c)

<button>

d)

<input type="click">

18.

Which HTML attribute is used to define the relationship between a linked document and the current document?

a)

link

b)

rel

c)

href

d)

type

19.

Which attribute is used to specify an alternate text for an image, if the image cannot be displayed?

a)

src

b)

alt

c)

title

d)

text

20.

What is the purpose of the `` tag in HTML5?

a)

To represent a figure, like an image with a caption

b)

To create a numbered list

c)

To display mathematical calculations

d)

To define a footer for a document

21.

Which attribute is used with the `` tag to open a hyperlink in a new window/tab?

a)

href

b)

target

c)

link

d)

rel

22.

Which tag is used to define an unordered list?

a)

<ul>

b)

<ol>

c)

<li>

d)

<dl>

23.

Which tag would you use to insert a line break in HTML?

a)

<lb>

b)

<br>

c)
  • <break>

d)
  • <line>

24.

Which tag is used to define a container for external interactive content or plugins in HTML5?

a)

<embed>

b)

<iframe>

c)

<object>

d)

All of the above

25.

What is the purpose of the `` element in HTML5?

a)

To display the current time

b)

To define a specific time (e.g., 20:00)

c)

To represent a date and/or time

d)

To measure the duration of a process

26.

Which HTML attribute is used to specify that an input field should have autocomplete enabled?

a)

autocomplete

b)

autocompletion

c)

auto

d)

autofill

27.

Which tag is used to define a description list in HTML?

a)
  • <ul>

b)
  • <ol>

c)
  • <dl>

d)
  • <list>

28.

What is the correct HTML tag for creating a checkbox?

a)
  • <checkbox>

b)
  • <input type="checkbox">

c)
  • <input type="check">

d)
  • <check>

29.

Which element is used to define navigation links in HTML5?

a)
  • <navigation>

b)
  • <nav>

c)
  • <navbar>

d)

<links>

30.

Which HTML5 element is used to embed video files?

a)
  • <video>

b)
  • <movie>

c)
  • <media>

d)
  • <embed>