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
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.
What does HTML stand for?
Hyper Text Markup Language
High Tech Modern Language
Hyper Transfer Markup Language
Hyper Text Machine Language
Which HTML tag is used to define the document type?
<!DOCTYPE html>
<html>
<head>
<title>
Which tag is used to create a hyperlink in HTML?
<a>
<link>
<href>
<url>
What is the correct HTML element for inserting a line break?
<br>
<break>
<lb>
<newline>
Which HTML attribute specifies an alternate text for an image?
alt
src
title
href
Which tag is used to define a paragraph?
<p>
<para>
<paragraph>
<text>
Which tag is used to define a heading in HTML?
<h1> to <h6>
<head>
<header>
<heading>
Which tag is used to define an unordered list?
<ul>
<ol>
<li>
<list>
Which tag is used to define a table row?
<tr>
<td>
<th>
<row>
Which tag is used to define a division or section in HTML?
<div>
<span>
<section>
<block>
Which tag is used to define a form?
<form>
<input>
<label>
<fieldset>
Which tag is used to define a button in HTML?
<button>
<input type='button'>
Both A and B
<btn>
Which attribute is used to specify the URL of a link?
href
src
link
url
Which attribute is used to specify the source of an image?
src
href
alt
source
Which attribute is used to specify the width of an image?
width
height
size
dimension
Which attribute is used to open a link in a new tab?
target='_blank'
target='_new'
new='true'
open='new'
Which attribute is used to disable an input field?
disabled
readonly
hidden
inactive
Which attribute is used to set the maximum length of an input?
maxlength
max
length
maxlen
Which input type is used for email addresses?
text
password
tel
Which input type is used for password fields?
password
text
hidden
secret
Which tag is used to create a dropdown list?
<select>
<dropdown>
<list>
<option>
Which tag is used to define a label for a form element?
<label>
<legend>
<caption>
<span>
Which input type is used to submit a form?
submit
button
reset
image
Which method should be used to send form data securely?
POST
GET
SEND
PUT
Which tag is used to define a table header?
<th>
<td>
<tr>
<thead>
Which tag is used to define a table data cell?
<td>
<th>
<tr>
<tbody>
Which attribute is used to merge cells horizontally?
colspan
rowspan
merge
span
Which attribute is used to merge cells vertically?
rowspan
colspan
merge
vertical-span
Which tag is used to define a table footer?
<tfoot>
<tf>
<footer>
<table-foot>
Which tag is used to define a table body?
<tbody>
<tb>
<body>
<table-body>
Which tag is used to define an ordered list?
<ol>
<ul>
<li>
<list>
Which tag is used to define a list item?
<li>
<item>
<list-item>
<il>
Which tag is used to define a description list?
<dl>
<ul>
<ol>
<desclist>
Which tag is used to define a term in a description list?
<dt>
<dd>
<dl>
<term>
Which tag is used to define a description in a description list?
<dd>
<dt>
<dl>
<desc>
Which list type uses numbers by default?
Ordered list
Unordered list
Description list
Bullet list
Which tag is used to create a hyperlink?
<a>
<link>
<href>
<url>
Which attribute is used to specify the URL of a link?
href
src
url
link
How do you create a link with a different target?
Using the target attribute
Using the href attribute
Using the rel attribute
Using the type attribute
Which value opens a link in a new window/tab?
_blank
_self
_parent
_top
Which tag is used to link to an external CSS file?
<link>
<a>
<style>
<script>
Which attribute is used to specify the relationship of a linked resource?
rel
type
media
href
Which tag is used to embed an image?
<img>
<image>
<src>
<picture>
Which tag is used to embed a video?
<video>
<media>
<movie>
<source>
Which tag is used to embed an audio file?
<audio>
<sound>
<music>
<play>
Which attribute is used to specify the source of a video?
src
href
source
data
Which tag is used to specify multiple sources for a video?
<source>
<src>
<media>
<data>
Which attribute makes a video autoplay?
autoplay
loop
play
start
Which tag defines the main content of a document?
<main>
<body>
<section>
<article>
Which tag defines a header for a document or section?
<header>
<head>
<top>
<banner>
Which tag defines a footer for a document or section?
<footer>
<bottom>
<foot>
<end>
Which tag defines a navigation menu?
<nav>
<menu>
<navigation>
<navbar>
Which tag defines an independent piece of content?
<article>
<section>
<div>
<aside>
Which tag defines content aside from the main content?
<aside>
<sidebar>
<side>
<extra>
Which input type is new in HTML5 for date selection?
date
datetime
calendar
time
Which HTML5 element is used for drawing graphics?
<canvas>
<svg>
<graph>
<draw>
Which HTML5 element is used for semantic grouping of content?
<section>
<group>
<block>
<content>
Which HTML5 element is used for progress bars?
<progress>
<meter>
<bar>
<status>
Which HTML5 attribute is used to validate input using a pattern?
pattern
validate
regex
format
Which HTML5 tag is used to include external application content?
<embed>
<object>
<iframe>
All of the above
Which attribute provides a text alternative for images?
alt
title
aria-label
role
Which ARIA role is used to define a landmark?
role='main'
role='navigation'
role='banner'
All of the above
Which attribute is used to associate a label with a form control?
for
id
aria-labelledby
All of the above
Which element is used to group related form controls for accessibility?
<fieldset>
<group>
<legend>
<label>
What is the purpose of the 'aria-label' attribute?
Provides a label for an element when no visible text is present
Specifies the role of an element
Defines the state of an element
Sets the tab order
Which HTML element is used to provide a caption for a table?
<caption>
<legend>
<label>
<summary>
What is the DOM?
Document Object Model - a programming interface for HTML documents
Data Object Model
Document Oriented Model
Dynamic Object Model
Which method is used to select an element by its ID?
document.getElementById()
document.querySelector()
document.getElementsByTagName()
document.getElementsByClassName()
Which property is used to get or set the HTML content of an element?
innerHTML
outerHTML
textContent
innerText
Which method is used to create a new element in the DOM?
document.createElement()
document.newElement()
document.addElement()
document.createNode()
Which method is used to append a child element?
appendChild()
addChild()
insertChild()
pushChild()
Which event occurs when the user clicks on an element?
onclick
onmouseover
onchange
onsubmit
Which event fires when the page is loaded?
onload
onloadstart
onready
onpageload
Which event fires when an input field loses focus?
onblur
onfocus
onchange
oninput
Which event fires when a form is submitted?
onsubmit
onform
onpost
onsend
Which event fires when the mouse moves over an element?
onmouseover
onmouseenter
onmouseout
onmousemove
Which event fires when a key is pressed?
onkeydown
onkeypress
onkeyup
All of the above
Which event fires when an element is changed?
onchange
oninput
onupdate
onmodify
What is the correct HTML element for the largest heading?
<h1>
<heading>
<h6>
<head>
Which tag is used to define a horizontal rule?
<hr>
<line>
<rule>
<br>
Which attribute is used to specify the style of an element?
style
class
id
css
Which input type is used to create a checkbox?
checkbox
radio
toggle
switch
Which tag is used to define a table caption?
<caption>
<thead>
<tfoot>
<legend>
Which tag is used to start a list item in an unordered list?
<li>
<item>
<list>
<ul>
Which attribute is used to specify the target URL in a form?
action
method
target
href
Which attribute controls whether a video should loop?
loop
repeat
autoplay
controls
Which tag is used to define a time or date?
<time>
<date>
<datetime>
<calendar>
Which HTML5 element is used for scalable vector graphics?
<svg>
<canvas>
<vector>
<graphics>
Which attribute is used to specify the language of an element?
lang
xml:lang
Both A and B
locale
Which method is used to remove an element from the DOM?
removeChild()
deleteChild()
removeElement()
eraseElement()
Which event fires when the document is unloaded?
onunload
onbeforeunload
onleave
onexit
Which HTML element defines the root of an HTML document?
<html>
<document>
<root>
<body>
Which tag is used to define an inline container?
<span>
<div>
<inline>
<container>
Which attribute is used to specify the character encoding?
charset
encoding
char
codepage
Which input type is used for numeric values?
number
range
text
tel
Which attribute defines the number of columns in a table?
colspan
rowspan
col
cols
Which tag is used to create a nested list?
Place a list inside a list item
<nest>
<sublist>
<inner>
Which attribute is used to specify the media type of a linked resource?
media
type
rel
href
Which tag is used to define a track for media elements?
<track>
<source>
<caption>
<subtitles>
Which tag is used to define a figure caption?
<figcaption>
<caption>
<legend>
<figure>
Which input type is used for color selection?
color
picker
rgb
hex
Which HTML element is used to define a heading for a section?
<h1> to <h6>
<header>
<title>
<heading>
Which property is used to get the text content of an element?
textContent
innerText
innerHTML
outerHTML
Which event fires when a form control loses focus?
onblur
onfocus
onchange
oninput
Which HTML tag is used to define a comment?
<!-- comment -->
// comment
/* comment */
# comment
Which tag is used to define a preformatted text?
<pre>
<code>
<text>
<format>
Which attribute is used to set the height of an image?
height
width
size
dimension
Which input type is used to upload files?
file
upload
document
image
Which tag is used to group the header content in a table?
<thead>
<theadrow>
<thgroup>
<head>
Which attribute is used to start an ordered list from a specific number?
start
begin
value
count
Which attribute is used to specify the relationship between the current document and the linked document?
rel
type
media
rev
Which attribute is used to specify if an audio file should autoplay?
autoplay
loop
controls
muted
Which tag is used to define a mark or highlighted text?
<mark>
<highlight>
<strong>
<em>
Which element is used to measure data within a range?
<meter>
<progress>
<range>
<gauge>
Which attribute is used to provide a text alternative for non-text content?
alt
aria-label
title
All of the above
Which method is used to add a class to an element?
classList.add()
addClass()
setClass()
className = 'new'
Which event fires when the user double-clicks an element?
ondblclick
onclick
onmouseup
onmousedown
Which character is used to indicate an end tag?
</>
<>
/
>
Which tag is used to define a subscript text?
<sub>
<sup>
<low>
<under>
Which attribute is used to set the tab order of an element?
tabindex
order
tab
index
Which attribute is used to set the placeholder text in an input field?
placeholder
hint
label
default
Which tag is used to define a table column group?
<colgroup>
<col>
<group>
<columns>
Which tag is used to define the term in a description list?
<dt>
<dd>
<dl>
<term>
Which attribute is used to specify the character encoding of a linked resource?
charset
encoding
codepage
hreflang
Which attribute is used to specify the poster image for a video?
poster
cover
thumbnail
preview
Which tag is used to define a block of content that is thematically grouped?
<section>
<article>
<div>
<group>
Which HTML5 element is used for drawing graphics with JavaScript?
<canvas>
<svg>
<graphics>
<draw>
Which attribute is used to specify the ARIA role of an element?
role
aria-role
landmark
access
Which method is used to remove a class from an element?
classList.remove()
removeClass()
deleteClass()
className = ''
Which event fires when the user scrolls an element?
onscroll
onwheel
onmove
ondrag
Which HTML element is used to define the title of a document?
<title>
<head>
<meta>
<header>