🌐 130+ Questions • Updated 2026

HTML Multiple Choice Questions

Master HTML with 130+ curated MCQs covering basics, tags, attributes, forms, tables, lists, links, media, semantics, HTML5, accessibility, DOM, events, and more. Perfect for exams, interviews, and placements.

📚13 Topics
130+ Questions
🎯Exam Ready

📚Explore HTML Topics

📝HTML MCQs(131 questions)

1

What does HTML stand for?

  • A

    Hyper Text Markup Language

  • B

    High Tech Modern Language

  • C

    Hyper Transfer Markup Language

  • D

    Hyper Text Machine Language

Show Answer
A. Hyper Text Markup Language
2

Which HTML tag is used to define the document type?

  • A

    <!DOCTYPE html>

  • B

    <html>

  • C

    <head>

  • D

    <title>

Show Answer
A. <!DOCTYPE html>
3

Which tag is used to create a hyperlink in HTML?

  • A

    <a>

  • B

    <link>

  • C

    <href>

  • D

    <url>

Show Answer
A. <a>
4

What is the correct HTML element for inserting a line break?

  • A

    <br>

  • B

    <break>

  • C

    <lb>

  • D

    <newline>

Show Answer
A. <br>
5

Which HTML attribute specifies an alternate text for an image?

  • A

    alt

  • B

    src

  • C

    title

  • D

    href

Show Answer
A. alt
6

Which tag is used to define a paragraph?

  • A

    <p>

  • B

    <para>

  • C

    <paragraph>

  • D

    <text>

Show Answer
A. <p>
7

Which tag is used to define a heading in HTML?

  • A

    <h1> to <h6>

  • B

    <head>

  • C

    <header>

  • D

    <heading>

Show Answer
A. <h1> to <h6>
8

Which tag is used to define an unordered list?

  • A

    <ul>

  • B

    <ol>

  • C

    <li>

  • D

    <list>

Show Answer
A. <ul>
9

Which tag is used to define a table row?

  • A

    <tr>

  • B

    <td>

  • C

    <th>

  • D

    <row>

Show Answer
A. <tr>
10

Which tag is used to define a division or section in HTML?

  • A

    <div>

  • B

    <span>

  • C

    <section>

  • D

    <block>

Show Answer
A. <div>
11

Which tag is used to define a form?

  • A

    <form>

  • B

    <input>

  • C

    <label>

  • D

    <fieldset>

Show Answer
A. <form>
12

Which tag is used to define a button in HTML?

  • A

    <button>

  • B

    <input type='button'>

  • C

    Both A and B

  • D

    <btn>

Show Answer
C. Both A and B
13

Which attribute is used to specify the URL of a link?

  • A

    href

  • B

    src

  • C

    link

  • D

    url

Show Answer
A. href
14

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

  • A

    src

  • B

    href

  • C

    alt

  • D

    source

Show Answer
A. src
15

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

  • A

    width

  • B

    height

  • C

    size

  • D

    dimension

Show Answer
A. width
16

Which attribute is used to open a link in a new tab?

  • A

    target='_blank'

  • B

    target='_new'

  • C

    new='true'

  • D

    open='new'

Show Answer
A. target='_blank'
17

Which attribute is used to disable an input field?

  • A

    disabled

  • B

    readonly

  • C

    hidden

  • D

    inactive

Show Answer
A. disabled
18

Which attribute is used to set the maximum length of an input?

  • A

    maxlength

  • B

    max

  • C

    length

  • D

    maxlen

Show Answer
A. maxlength
19

Which input type is used for email addresses?

  • A

    email

  • B

    text

  • C

    password

  • D

    tel

Show Answer
A. email
20

Which input type is used for password fields?

  • A

    password

  • B

    text

  • C

    hidden

  • D

    secret

Show Answer
A. password
21

Which tag is used to create a dropdown list?

  • A

    <select>

  • B

    <dropdown>

  • C

    <list>

  • D

    <option>

Show Answer
A. <select>
22

Which tag is used to define a label for a form element?

  • A

    <label>

  • B

    <legend>

  • C

    <caption>

  • D

    <span>

Show Answer
A. <label>
23

Which input type is used to submit a form?

  • A

    submit

  • B

    button

  • C

    reset

  • D

    image

Show Answer
A. submit
24

Which method should be used to send form data securely?

  • A

    POST

  • B

    GET

  • C

    SEND

  • D

    PUT

Show Answer
A. POST
25

Which tag is used to define a table header?

  • A

    <th>

  • B

    <td>

  • C

    <tr>

  • D

    <thead>

Show Answer
A. <th>
26

Which tag is used to define a table data cell?

  • A

    <td>

  • B

    <th>

  • C

    <tr>

  • D

    <tbody>

Show Answer
A. <td>
27

Which attribute is used to merge cells horizontally?

  • A

    colspan

  • B

    rowspan

  • C

    merge

  • D

    span

Show Answer
A. colspan
28

Which attribute is used to merge cells vertically?

  • A

    rowspan

  • B

    colspan

  • C

    merge

  • D

    vertical-span

Show Answer
A. rowspan
29

Which tag is used to define a table footer?

  • A

    <tfoot>

  • B

    <tf>

  • C

    <footer>

  • D

    <table-foot>

Show Answer
A. <tfoot>
30

Which tag is used to define a table body?

  • A

    <tbody>

  • B

    <tb>

  • C

    <body>

  • D

    <table-body>

Show Answer
A. <tbody>
31

Which tag is used to define an ordered list?

  • A

    <ol>

  • B

    <ul>

  • C

    <li>

  • D

    <list>

Show Answer
A. <ol>
32

Which tag is used to define a list item?

  • A

    <li>

  • B

    <item>

  • C

    <list-item>

  • D

    <il>

Show Answer
A. <li>
33

Which tag is used to define a description list?

  • A

    <dl>

  • B

    <ul>

  • C

    <ol>

  • D

    <desclist>

Show Answer
A. <dl>
34

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

  • A

    <dt>

  • B

    <dd>

  • C

    <dl>

  • D

    <term>

Show Answer
A. <dt>
35

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

  • A

    <dd>

  • B

    <dt>

  • C

    <dl>

  • D

    <desc>

Show Answer
A. <dd>
36

Which list type uses numbers by default?

  • A

    Ordered list

  • B

    Unordered list

  • C

    Description list

  • D

    Bullet list

Show Answer
A. Ordered list
37

Which tag is used to create a hyperlink?

  • A

    <a>

  • B

    <link>

  • C

    <href>

  • D

    <url>

Show Answer
A. <a>
38

Which attribute is used to specify the URL of a link?

  • A

    href

  • B

    src

  • C

    url

  • D

    link

Show Answer
A. href
39

How do you create a link with a different target?

  • A

    Using the target attribute

  • B

    Using the href attribute

  • C

    Using the rel attribute

  • D

    Using the type attribute

Show Answer
A. Using the target attribute
40

Which value opens a link in a new window/tab?

  • A

    _blank

  • B

    _self

  • C

    _parent

  • D

    _top

Show Answer
A. _blank
41

Which tag is used to link to an external CSS file?

  • A

    <link>

  • B

    <a>

  • C

    <style>

  • D

    <script>

Show Answer
A. <link>
42

Which attribute is used to specify the relationship of a linked resource?

  • A

    rel

  • B

    type

  • C

    media

  • D

    href

Show Answer
A. rel
43

Which tag is used to embed an image?

  • A

    <img>

  • B

    <image>

  • C

    <src>

  • D

    <picture>

Show Answer
A. <img>
44

Which tag is used to embed a video?

  • A

    <video>

  • B

    <media>

  • C

    <movie>

  • D

    <source>

Show Answer
A. <video>
45

Which tag is used to embed an audio file?

  • A

    <audio>

  • B

    <sound>

  • C

    <music>

  • D

    <play>

Show Answer
A. <audio>
46

Which attribute is used to specify the source of a video?

  • A

    src

  • B

    href

  • C

    source

  • D

    data

Show Answer
A. src
47

Which tag is used to specify multiple sources for a video?

  • A

    <source>

  • B

    <src>

  • C

    <media>

  • D

    <data>

Show Answer
A. <source>
48

Which attribute makes a video autoplay?

  • A

    autoplay

  • B

    loop

  • C

    play

  • D

    start

Show Answer
A. autoplay
49

Which tag defines the main content of a document?

  • A

    <main>

  • B

    <body>

  • C

    <section>

  • D

    <article>

Show Answer
A. <main>
50

Which tag defines a header for a document or section?

  • A

    <header>

  • B

    <head>

  • C

    <top>

  • D

    <banner>

Show Answer
A. <header>
51

Which tag defines a footer for a document or section?

  • A

    <footer>

  • B

    <bottom>

  • C

    <foot>

  • D

    <end>

Show Answer
A. <footer>
52

Which tag defines a navigation menu?

  • A

    <nav>

  • B

    <menu>

  • C

    <navigation>

  • D

    <navbar>

Show Answer
A. <nav>
53

Which tag defines an independent piece of content?

  • A

    <article>

  • B

    <section>

  • C

    <div>

  • D

    <aside>

Show Answer
A. <article>
54

Which tag defines content aside from the main content?

  • A

    <aside>

  • B

    <sidebar>

  • C

    <side>

  • D

    <extra>

Show Answer
A. <aside>
55

Which input type is new in HTML5 for date selection?

  • A

    date

  • B

    datetime

  • C

    calendar

  • D

    time

Show Answer
A. date
56

Which HTML5 element is used for drawing graphics?

  • A

    <canvas>

  • B

    <svg>

  • C

    <graph>

  • D

    <draw>

Show Answer
A. <canvas>
57

Which HTML5 element is used for semantic grouping of content?

  • A

    <section>

  • B

    <group>

  • C

    <block>

  • D

    <content>

Show Answer
A. <section>
58

Which HTML5 element is used for progress bars?

  • A

    <progress>

  • B

    <meter>

  • C

    <bar>

  • D

    <status>

Show Answer
A. <progress>
59

Which HTML5 attribute is used to validate input using a pattern?

  • A

    pattern

  • B

    validate

  • C

    regex

  • D

    format

Show Answer
A. pattern
60

Which HTML5 tag is used to include external application content?

  • A

    <embed>

  • B

    <object>

  • C

    <iframe>

  • D

    All of the above

Show Answer
D. All of the above
61

Which attribute provides a text alternative for images?

  • A

    alt

  • B

    title

  • C

    aria-label

  • D

    role

Show Answer
A. alt
62

Which ARIA role is used to define a landmark?

  • A

    role='main'

  • B

    role='navigation'

  • C

    role='banner'

  • D

    All of the above

Show Answer
D. All of the above
63

Which attribute is used to associate a label with a form control?

  • A

    for

  • B

    id

  • C

    aria-labelledby

  • D

    All of the above

Show Answer
D. All of the above
64

Which element is used to group related form controls for accessibility?

  • A

    <fieldset>

  • B

    <group>

  • C

    <legend>

  • D

    <label>

Show Answer
A. <fieldset>
65

What is the purpose of the 'aria-label' attribute?

  • A

    Provides a label for an element when no visible text is present

  • B

    Specifies the role of an element

  • C

    Defines the state of an element

  • D

    Sets the tab order

Show Answer
A. Provides a label for an element when no visible text is present
66

Which HTML element is used to provide a caption for a table?

  • A

    <caption>

  • B

    <legend>

  • C

    <label>

  • D

    <summary>

Show Answer
A. <caption>
67

What is the DOM?

  • A

    Document Object Model - a programming interface for HTML documents

  • B

    Data Object Model

  • C

    Document Oriented Model

  • D

    Dynamic Object Model

Show Answer
A. Document Object Model - a programming interface for HTML documents
68

Which method is used to select an element by its ID?

  • A

    document.getElementById()

  • B

    document.querySelector()

  • C

    document.getElementsByTagName()

  • D

    document.getElementsByClassName()

Show Answer
A. document.getElementById()
69

Which property is used to get or set the HTML content of an element?

  • A

    innerHTML

  • B

    outerHTML

  • C

    textContent

  • D

    innerText

Show Answer
A. innerHTML
70

Which method is used to create a new element in the DOM?

  • A

    document.createElement()

  • B

    document.newElement()

  • C

    document.addElement()

  • D

    document.createNode()

Show Answer
A. document.createElement()
71

Which method is used to append a child element?

  • A

    appendChild()

  • B

    addChild()

  • C

    insertChild()

  • D

    pushChild()

Show Answer
A. appendChild()
72

Which event occurs when the user clicks on an element?

  • A

    onclick

  • B

    onmouseover

  • C

    onchange

  • D

    onsubmit

Show Answer
A. onclick
73

Which event fires when the page is loaded?

  • A

    onload

  • B

    onloadstart

  • C

    onready

  • D

    onpageload

Show Answer
A. onload
74

Which event fires when an input field loses focus?

  • A

    onblur

  • B

    onfocus

  • C

    onchange

  • D

    oninput

Show Answer
A. onblur
75

Which event fires when a form is submitted?

  • A

    onsubmit

  • B

    onform

  • C

    onpost

  • D

    onsend

Show Answer
A. onsubmit
76

Which event fires when the mouse moves over an element?

  • A

    onmouseover

  • B

    onmouseenter

  • C

    onmouseout

  • D

    onmousemove

Show Answer
A. onmouseover
77

Which event fires when a key is pressed?

  • A

    onkeydown

  • B

    onkeypress

  • C

    onkeyup

  • D

    All of the above

Show Answer
D. All of the above
78

Which event fires when an element is changed?

  • A

    onchange

  • B

    oninput

  • C

    onupdate

  • D

    onmodify

Show Answer
A. onchange
79

What is the correct HTML element for the largest heading?

  • A

    <h1>

  • B

    <heading>

  • C

    <h6>

  • D

    <head>

Show Answer
A. <h1>
80

Which tag is used to define a horizontal rule?

  • A

    <hr>

  • B

    <line>

  • C

    <rule>

  • D

    <br>

Show Answer
A. <hr>
81

Which attribute is used to specify the style of an element?

  • A

    style

  • B

    class

  • C

    id

  • D

    css

Show Answer
A. style
82

Which input type is used to create a checkbox?

  • A

    checkbox

  • B

    radio

  • C

    toggle

  • D

    switch

Show Answer
A. checkbox
83

Which tag is used to define a table caption?

  • A

    <caption>

  • B

    <thead>

  • C

    <tfoot>

  • D

    <legend>

Show Answer
A. <caption>
84

Which tag is used to start a list item in an unordered list?

  • A

    <li>

  • B

    <item>

  • C

    <list>

  • D

    <ul>

Show Answer
A. <li>
85

Which attribute is used to specify the target URL in a form?

  • A

    action

  • B

    method

  • C

    target

  • D

    href

Show Answer
A. action
86

Which attribute controls whether a video should loop?

  • A

    loop

  • B

    repeat

  • C

    autoplay

  • D

    controls

Show Answer
A. loop
87

Which tag is used to define a time or date?

  • A

    <time>

  • B

    <date>

  • C

    <datetime>

  • D

    <calendar>

Show Answer
A. <time>
88

Which HTML5 element is used for scalable vector graphics?

  • A

    <svg>

  • B

    <canvas>

  • C

    <vector>

  • D

    <graphics>

Show Answer
A. <svg>
89

Which attribute is used to specify the language of an element?

  • A

    lang

  • B

    xml:lang

  • C

    Both A and B

  • D

    locale

Show Answer
C. Both A and B
90

Which method is used to remove an element from the DOM?

  • A

    removeChild()

  • B

    deleteChild()

  • C

    removeElement()

  • D

    eraseElement()

Show Answer
A. removeChild()
91

Which event fires when the document is unloaded?

  • A

    onunload

  • B

    onbeforeunload

  • C

    onleave

  • D

    onexit

Show Answer
A. onunload
92

Which HTML element defines the root of an HTML document?

  • A

    <html>

  • B

    <document>

  • C

    <root>

  • D

    <body>

Show Answer
A. <html>
93

Which tag is used to define an inline container?

  • A

    <span>

  • B

    <div>

  • C

    <inline>

  • D

    <container>

Show Answer
A. <span>
94

Which attribute is used to specify the character encoding?

  • A

    charset

  • B

    encoding

  • C

    char

  • D

    codepage

Show Answer
A. charset
95

Which input type is used for numeric values?

  • A

    number

  • B

    range

  • C

    text

  • D

    tel

Show Answer
A. number
96

Which attribute defines the number of columns in a table?

  • A

    colspan

  • B

    rowspan

  • C

    col

  • D

    cols

Show Answer
A. colspan
97

Which tag is used to create a nested list?

  • A

    Place a list inside a list item

  • B

    <nest>

  • C

    <sublist>

  • D

    <inner>

Show Answer
A. Place a list inside a list item
98

Which attribute is used to specify the media type of a linked resource?

  • A

    media

  • B

    type

  • C

    rel

  • D

    href

Show Answer
A. media
99

Which tag is used to define a track for media elements?

  • A

    <track>

  • B

    <source>

  • C

    <caption>

  • D

    <subtitles>

Show Answer
A. <track>
100

Which tag is used to define a figure caption?

  • A

    <figcaption>

  • B

    <caption>

  • C

    <legend>

  • D

    <figure>

Show Answer
A. <figcaption>
101

Which input type is used for color selection?

  • A

    color

  • B

    picker

  • C

    rgb

  • D

    hex

Show Answer
A. color
102

Which HTML element is used to define a heading for a section?

  • A

    <h1> to <h6>

  • B

    <header>

  • C

    <title>

  • D

    <heading>

Show Answer
A. <h1> to <h6>
103

Which property is used to get the text content of an element?

  • A

    textContent

  • B

    innerText

  • C

    innerHTML

  • D

    outerHTML

Show Answer
A. textContent
104

Which event fires when a form control loses focus?

  • A

    onblur

  • B

    onfocus

  • C

    onchange

  • D

    oninput

Show Answer
A. onblur
105

Which HTML tag is used to define a comment?

  • A

    <!-- comment -->

  • B

    // comment

  • C

    /* comment */

  • D

    # comment

Show Answer
A. <!-- comment -->
106

Which tag is used to define a preformatted text?

  • A

    <pre>

  • B

    <code>

  • C

    <text>

  • D

    <format>

Show Answer
A. <pre>
107

Which attribute is used to set the height of an image?

  • A

    height

  • B

    width

  • C

    size

  • D

    dimension

Show Answer
A. height
108

Which input type is used to upload files?

  • A

    file

  • B

    upload

  • C

    document

  • D

    image

Show Answer
A. file
109

Which tag is used to group the header content in a table?

  • A

    <thead>

  • B

    <theadrow>

  • C

    <thgroup>

  • D

    <head>

Show Answer
A. <thead>
110

Which attribute is used to start an ordered list from a specific number?

  • A

    start

  • B

    begin

  • C

    value

  • D

    count

Show Answer
A. start
111

Which attribute is used to specify the relationship between the current document and the linked document?

  • A

    rel

  • B

    type

  • C

    media

  • D

    rev

Show Answer
A. rel
112

Which attribute is used to specify if an audio file should autoplay?

  • A

    autoplay

  • B

    loop

  • C

    controls

  • D

    muted

Show Answer
A. autoplay
113

Which tag is used to define a mark or highlighted text?

  • A

    <mark>

  • B

    <highlight>

  • C

    <strong>

  • D

    <em>

Show Answer
A. <mark>
114

Which element is used to measure data within a range?

  • A

    <meter>

  • B

    <progress>

  • C

    <range>

  • D

    <gauge>

Show Answer
A. <meter>
115

Which attribute is used to provide a text alternative for non-text content?

  • A

    alt

  • B

    aria-label

  • C

    title

  • D

    All of the above

Show Answer
D. All of the above
116

Which method is used to add a class to an element?

  • A

    classList.add()

  • B

    addClass()

  • C

    setClass()

  • D

    className = 'new'

Show Answer
A. classList.add()
117

Which event fires when the user double-clicks an element?

  • A

    ondblclick

  • B

    onclick

  • C

    onmouseup

  • D

    onmousedown

Show Answer
A. ondblclick
118

Which character is used to indicate an end tag?

  • A

    </>

  • B

    <>

  • C

    /

  • D

    >

Show Answer
A. </>
119

Which tag is used to define a subscript text?

  • A

    <sub>

  • B

    <sup>

  • C

    <low>

  • D

    <under>

Show Answer
A. <sub>
120

Which attribute is used to set the tab order of an element?

  • A

    tabindex

  • B

    order

  • C

    tab

  • D

    index

Show Answer
A. tabindex
121

Which attribute is used to set the placeholder text in an input field?

  • A

    placeholder

  • B

    hint

  • C

    label

  • D

    default

Show Answer
A. placeholder
122

Which tag is used to define a table column group?

  • A

    <colgroup>

  • B

    <col>

  • C

    <group>

  • D

    <columns>

Show Answer
A. <colgroup>
123

Which tag is used to define the term in a description list?

  • A

    <dt>

  • B

    <dd>

  • C

    <dl>

  • D

    <term>

Show Answer
A. <dt>
124

Which attribute is used to specify the character encoding of a linked resource?

  • A

    charset

  • B

    encoding

  • C

    codepage

  • D

    hreflang

Show Answer
A. charset
125

Which attribute is used to specify the poster image for a video?

  • A

    poster

  • B

    cover

  • C

    thumbnail

  • D

    preview

Show Answer
A. poster
126

Which tag is used to define a block of content that is thematically grouped?

  • A

    <section>

  • B

    <article>

  • C

    <div>

  • D

    <group>

Show Answer
A. <section>
127

Which HTML5 element is used for drawing graphics with JavaScript?

  • A

    <canvas>

  • B

    <svg>

  • C

    <graphics>

  • D

    <draw>

Show Answer
A. <canvas>
128

Which attribute is used to specify the ARIA role of an element?

  • A

    role

  • B

    aria-role

  • C

    landmark

  • D

    access

Show Answer
A. role
129

Which method is used to remove a class from an element?

  • A

    classList.remove()

  • B

    removeClass()

  • C

    deleteClass()

  • D

    className = ''

Show Answer
A. classList.remove()
130

Which event fires when the user scrolls an element?

  • A

    onscroll

  • B

    onwheel

  • C

    onmove

  • D

    ondrag

Show Answer
A. onscroll
131

Which HTML element is used to define the title of a document?

  • A

    <title>

  • B

    <head>

  • C

    <meta>

  • D

    <header>

Show Answer
A. <title>

Frequently Asked Questions

What is HTML and why is it important?
HTML (Hyper Text Markup Language) is the standard markup language for creating web pages. It defines the structure of content on the web. HTML is the foundation of all web development, working alongside CSS for styling and JavaScript for interactivity.
What is the difference between HTML and HTML5?
HTML5 is the latest version of HTML, introducing new semantic elements (like <article>, <section>, <nav>), new input types (date, color, range), support for audio/video without plugins, canvas for graphics, and improved APIs for web applications.
What are the basic structure tags of an HTML document?
Every HTML document has a basic structure: <!DOCTYPE html> at the top, followed by <html>, which contains <head> (with <title>, meta tags, links to CSS) and <body> (where visible content is placed).
What is the difference between block-level and inline elements?
Block-level elements (like <div>, <p>, <h1>) start on a new line and take up full width. Inline elements (like <span>, <a>, <img>) do not start on a new line and only take up as much space as needed.
How do you create a hyperlink in HTML?
Use the <a> tag with the href attribute: <a href='https://example.com'>Link text</a>. You can also add target='_blank' to open in a new tab.
What is the role of the 'alt' attribute in images?
The alt attribute provides alternative text for an image if it cannot be displayed. It is essential for accessibility (screen readers) and improves SEO.
What is a semantic HTML element and why use it?
Semantic elements (like <header>, <footer>, <article>, <nav>) clearly describe their meaning to both the browser and developer. They improve accessibility, SEO, and maintainability of code.
How do you create a form in HTML?
Use the <form> tag with action (where to send data) and method (GET or POST). Inside, use input elements like text, password, submit, etc., with labels for usability.