Learn HTML MCQs

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

Which tag is used to define a clickable hyperlink?

1) <href>

2) <link>

3) <url>

4) <a>

Answer : <a>

What does the `disabled` attribute do in an input element?

1) Makes the field uneditable

2) Hides the field

3) Disables validation

4) Removes the field

Answer : Makes the field uneditable

Which HTML element is used for defining a footer in a webpage?

1) <bottom>

2) <header>

3) <footer>

4) <section>

Answer : <footer>

What is the purpose of the `<canvas>` element?

1) Create animations

2) Draw graphics

3) Display images

4) Render videos

Answer : Draw graphics

Which tag is used for making text bold in HTML?

1) <b>

2) <strong>

3) <em>

4) <bold>

Answer : <strong>

Which attribute specifies the character encoding for the HTML document?

1) encoding

2) type

3) meta

4) charset

Answer : charset

Which HTML element is used to create a table row?

1) <td>

2) <tr>

3) <th>

4) <table>

Answer : <tr>

Which attribute is used to specify the width of a table column?

1) colwidth

2) width

3) length

4) size

Answer : width

What is the purpose of the `alt` attribute in an `<img>` tag?

1) Specify the image URL

2) Provide alternative text for an image

3) Create a link to the image

4) Define the image size

Answer : Provide alternative text for an image

Which tag is used for defining the main content of a document?

1) <body>

2) <main>

3) <section>

4) <content>

Answer : <main>