Learn HTML MCQs

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

Which HTML attribute is used to specify the URL of a linked document?

1) href

2) src

3) link

4) url

Answer : href

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

1) Defines an input field

2) Creates a button

3) Defines a paragraph

4) Defines a link

Answer : Defines an input field

Which HTML element is used to define a description list?

1) <dl>

2) <dd>

3) <dt>

4) <list>

Answer : <dl>

Which HTML tag is used to create a table header?

1) <th>

2) <thead>

3) <header>

4) <tr>

Answer : <th>

What is the correct syntax to add an image in HTML?

1) <img src="image.jpg">

2) <image src="image.jpg">

3) <img href="image.jpg">

4) <src="image.jpg">

Answer : <img src="image.jpg">

Which tag is used to specify a section in a document?

1) <section>

2) <div>

3) <article>

4) <aside>

Answer : <section>

Which tag is used to create a horizontal line in HTML?

1) <hr>

2) <line>

3) <br>

4) <hline>

Answer : <hr>

How can you make a text italic in HTML?

1) <i>

2) <italic>

3) <em>

4) <strong>

Answer : <i>

Which element is used to create a drop-down list?

1) <select>

2) <option>

3) <list>

4) <dropdown>

Answer : <select>

Which attribute is used to define an alternative text for an image in case the image cannot be displayed?

1) alt

2) src

3) title

4) text

Answer : alt