Learn HTML MCQs
Prepare HTML MCQs (Multiple choice Questions) for exam and job interviews.
Which HTML element is used to define a title for a webpage?
1) <head>
2) <h1>
3) <title>
4) <header>
Answer : <title>
What is the correct HTML element for specifying a group of related options in a dropdown?
1) <select>
2) <optgroup>
3) <option>
4) <fieldset>
Answer : <optgroup>
Which tag is used to create a checkbox in HTML?
1) <input type="check">
2) <checkbox>
3) <input type="box">
4) <input type="checkbox">
Answer : <input type="checkbox">
What does the `action` attribute in a `<form>` specify?
1) The method of submission
2) Where to send form data
3) The form title
4) The style of the form
Answer : Where to send form data
Which tag is used to create a horizontal line in HTML?
1) <line>
2) <hr>
3) <hline>
4) <separator>
Answer : <hr>
How can you specify that a link should open in a new tab?
1) newtab="true"
2) target="_blank"
3) open="new"
4) target="_new"
Answer : target="_blank"
Which attribute is used to make an input field required?
1) mandatory
2) needed
3) valid
4) required
Answer : required
What does the `<iframe>` element allow you to do?
1) Create frames
2) Display a video
3) Embed another document
4) Link to an external source
Answer : Embed another document
Which HTML element is used for defining a list item?
1) <item>
2) <li>
3) <listitem>
4) <liitem>
Answer : <li>
What is the purpose of the `name` attribute in form elements?
1) To create a title
2) To identify form data
3) To define the style
4) To set a default value
Answer : To identify form data