Learn HTML MCQs

Prepare HTML MCQs (Multiple choice Questions) for exam and job interviews.

Which HTML element is used to define a list item?

1) <li>

2) <item>

3) <list-item>

4) <li-item>

Answer : <li>

How do you include a JavaScript file in HTML?

1) <script src="file.js"></script>

2) <js src="file.js"></js>

3) <link src="file.js">

4) <include src="file.js">

Answer : <script src="file.js"></script>

What does the `<strong>` tag do in HTML?

1) Defines important text

2) Creates a heading

3) Styles text

4) Defines a section

Answer : Defines important text

How can you change the text color in HTML?

1) Using the `style` attribute

2) Using the `color` attribute

3) Using the `bgcolor` attribute

4) Using CSS only

Answer : Using the `style` attribute

What is the correct way to specify an email link in HTML?

1) <a href="mailto:[email protected]">Email</a>

2) <link href="mailto:[email protected]">Email</link>

3) <email href="mailto:[email protected]">Email</email>

4) <a mailto="[email protected]">Email</a>

Answer : <a href="mailto:[email protected]">Email</a>

How do you create a text area in HTML?

1) <textarea></textarea>

2) <input type="textarea">

3) <text></text>

4) <area></area>

Answer : <textarea></textarea>

Which attribute is used to specify the source of an image?

1) src

2) href

3) link

4) img

Answer : src

What does the `<figure>` tag represent in HTML?

1) Content related to a figure

2) A graphical element

3) An image

4) A table

Answer : Content related to a figure

How do you create a horizontal line in HTML?

1) <hr>

2) <line>

3) <hrule>

4) <horizontal>

Answer : <hr>

What is the purpose of the `<section>` tag?

1) Defines a section

2) Creates a header

3) Styles content

4) Defines a group of elements

Answer : Defines a section