100 Essential HTML5 Questions to test and expand your knowledge

QUIZ 100 Questions LEARN HTML 🌐 Elevate Your Skills Learn more about HTML5!

🌐🚀 Exciting News for Web Developers and Enthusiasts!

We’ve just released an article packed with 100 Essential HTML5 Questions to test and expand your knowledge! Whether you’re a seasoned developer or just starting out, this is a must-read. 📘💡

Dive deep into the world of HTML5 with questions ranging from basic concepts to advanced functionalities. Here’s a sneak peek:

  1. What does HTML stand for?
  2. New elements in HTML5?
  3. Purpose of the <canvas> element? … and 97 more! 🤯

Each question is crafted to challenge your understanding and help you master HTML5, the cornerstone of modern web development. 🌍💻

🔗 Check out the full article for a comprehensive learning experience!

🔥 #WebDevelopment #HTML5 #Coding #Programming #TechCommunity #DeveloperTools #WebDesign #FrontEndDevelopment #JavaScript #CSS #WebDev #CodingQuestions #LearnToCode #TechEducation #WebDeveloper #HTML5Questions #TechWorld #ProgrammingLife #100QuestionsChallenge

👉 Don’t forget to share your thoughts and insights in the comments. Let’s learn and grow together in this amazing tech community!

Question 1: What does HTML stand for?

  1. HyperText Markup Language
  2. HyperTech More Language
  3. HighText Machine Language
  4. None of the above

Answer: 1. HyperText Markup Language

Explanation: HTML stands for HyperText Markup Language. It is the standard markup language used for creating web pages and web applications. It structures the content on the web.

Question 2: Which of the following is a new element in HTML5?

  1. <div>
  2. <table>
  3. <article>
  4. <font>

Answer: 3. <article>

Explanation: <article> is a new element introduced in HTML5. It represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable.

Question 3: What is the purpose of the <canvas> element in HTML5?

  1. To display database records
  2. To draw graphics on the fly via scripting (like JavaScript)
  3. To add a background canvas to web pages
  4. To display 3D objects

Answer: 2. To draw graphics on the fly via scripting (like JavaScript)

Explanation: The <canvas> element in HTML5 is used to draw graphics on the fly via scripting languages such as JavaScript. It can be used to draw graphs, make photo compositions, create animations, or even do real-time video processing or rendering.

Question 4: Which HTML5 element is used to specify a footer for a document or section?

  1. <bottom>
  2. <footer>
  3. <section>
  4. <div>

Answer: 2. <footer>

Explanation: The <footer> element in HTML5 is used to define a footer for a document or a section. It typically contains authorship information, contact information, copyright notices, and related documents.

Question 5: What is the correct HTML5 element for playing video files?

  1. <media>
  2. <video>
  3. <film>
  4. <mp4>

Answer: 2. <video>

Explanation: The <video> element is used in HTML5 for embedding video content in a document. It can be used to play various video file formats. Attributes like src, controls, width, and height are often used with the <video> element.

Question 6: Which of the following is NOT a valid type for <input> in HTML5?

  1. email
  2. date
  3. slider
  4. color

Answer: 3. slider

Explanation: In HTML5, slider is not a valid type attribute value for <input>. The correct type for a slider is range.

Question 7: Which HTML5 element is used for drawing graphics, typically via JavaScript?

  1. <graphics>
  2. <canvas>
  3. <svg>
  4. <draw>

Answer: 2. <canvas>

Explanation: The <canvas> element is used in HTML5 for drawing graphics, usually with JavaScript. It allows for dynamic, scriptable rendering of 2D shapes and bitmap images.

Question 8: What does the async attribute in a <script> tag do?

  1. It stops the script until the page has finished parsing
  2. It runs the script asynchronously as soon as it is available
  3. It defers the script to run after the page has finished parsing
  4. It checks for syntax errors in the script

Answer: 2. It runs the script asynchronously as soon as it is available

Explanation: The async attribute in a <script> tag allows the script to be executed asynchronously as soon as it is available, without waiting for the entire page to be loaded.

Question 9: Which element is used in HTML5 to specify navigation links?

  1. <nav>
  2. <navigation>
  3. <links>
  4. <navigate>

Answer: 1. <nav>

Explanation: The <nav> element is used in HTML5 to define a section of navigation links.

Question 10: What is the purpose of the <aside> element in HTML5?

  1. To represent a section of the page with content connected indirectly to the main content
  2. To create sidebars for advertising
  3. To denote additional items that the user might need
  4. To highlight text

Answer: 1. To represent a section of the page with content connected indirectly to the main content

Explanation: The <aside> element is used in HTML5 to represent a section of a page that consists of content tangentially related to the content around the <aside> element.

Question 11: What does the figure element in HTML5 represent?

  1. A calculation or result
  2. A unit of length
  3. Self-contained content, like illustrations, diagrams, photos, code listings, etc.
  4. A key figure in a text

Answer: 3. Self-contained content, like illustrations, diagrams, photos, code listings, etc.

Explanation: The figure element represents self-contained content, typically referenced as a single unit from the main flow of the document, such as illustrations, diagrams, photos, code listings, etc.

Question 12: How do you define a header for a section or page in HTML5?

  1. <header>
  2. <head>
  3. <top>
  4. <sectionhead>

Answer: 1. <header>

Explanation: The <header> element in HTML5 is used to define a header for a document or a section.

Question 13: What is the purpose of the datalist element in HTML5?

  1. To store data offline
  2. To provide a list of pre-defined options to an <input> element
  3. To link to external data sources
  4. To display a list of items in a table format

Answer: 2. To provide a list of pre-defined options to an <input> element

Explanation: The datalist element in HTML5 provides a list of pre-defined options for an <input> element, allowing for an auto-complete feature.

Question 14: Which HTML5 element is used to play audio files?

  1. <sound>
  2. <mp3>
  3. <audio>
  4. <music>

Answer: 3. <audio>

Explanation: The <audio> element is used in HTML5 to embed sound content in documents. It can be used to play audio files.

Question 15: What is the purpose of the output element in HTML5?

  1. To display the output of a script
  2. To export data to an external file
  3. To define a section for user input
  4. To store output data in a database

Answer: 1. To display the output of a script

Explanation: The output element is used to represent the result of a calculation or user action in HTML5.

Question 16: Which attribute is used to specify that an input field must be filled out before submitting the form?

  1. required
  2. mandatory
  3. validate
  4. essential

Answer: 1. required

Explanation: The required attribute is used to specify that an input field cannot be left empty and must be filled out before submitting the form.

Question 17: What is the purpose of the article element in HTML5?

  1. To define a comment
  2. To contain a magazine or newspaper article
  3. To wrap an article about a particular subject
  4. Both 2 and 3

Answer: 4. Both 2 and 3

Explanation: The article element represents a piece of self-contained content, such as a newspaper or magazine article, a blog entry, or a user comment.

Question 18: Which of the following is NOT a semantic element in HTML5?

  1. <article>
  2. <footer>
  3. <div>
  4. <section>

Answer: 3. <div>

Explanation: <div> is a generic container in HTML and is not considered a semantic element. Semantic elements like <article>, <footer>, and <section> clearly describe their meaning in a human- and machine-readable way.

Question 19: Which HTML5 element is used for marking up a thematic break in a page?

  1. <break>
  2. <line>
  3. <hr>
  4. <divider>

Answer: 3. <hr>

Explanation: The <hr> element represents a thematic break between paragraph-level elements (for example, a change of scene in a story, or a shift of topic within a section).

Question 20: Which attribute is used with the meta tag to define the character set of an HTML document?

  1. charset
  2. encoding
  3. setchar
  4. character

Answer: 1. charset

Explanation: The charset attribute in the <meta> tag specifies the character encoding for the HTML document.

Question 21: What does the placeholder attribute provide in an input field?

  1. A default value that is submitted with the form
  2. A hint to the user of what can be entered in the field
  3. A label for the input field
  4. Mandatory text that must be entered by the user

Answer: 2. A hint to the user of what can be entered in the field

Explanation: The placeholder attribute provides a short hint that describes the expected value of an input field.

Question 22: Which HTML5 element defines independent, self-contained content?

  1. <section>
  2. <article>
  3. <aside>
  4. <header>

Answer: 2. <article>

Explanation: An <article> element specifies independent, self-contained content that could potentially be distributed or reused.

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

  1. <br>
  2. <break>
  3. <lb>
  4. <line>

Answer: 1. <br>

Explanation: The <br> tag is used in HTML to insert a line break in text.

Question 24: Which HTML5 element is used for specifying a group of introductory or navigational aids?

  1. <group>
  2. <section>
  3. <header>
  4. <nav>

Answer: 4. <nav>

Explanation: The <nav> element is used to define a set of navigation links in HTML5.

Question 25: What does the srcset attribute in the <img> element do?

  1. Sets a source for the image
  2. Defines multiple sizes of the same image
  3. Provides a textual description of the image
  4. Specifies the path to the image source

Answer: 2. Defines multiple sizes of the same image

Explanation: The srcset attribute in the <img> tag allows specifying different images to be displayed based on the screen size or resolution, enabling responsive image loading.


Question 26: Which attribute in the <a> tag specifies the URL of the page the link goes to?

  1. href
  2. src
  3. link
  4. url

Answer: 1. href

Explanation: The href attribute in the <a> (anchor) tag specifies the URL of the page the link goes to.

Question 27: What does the viewport meta tag do in HTML5?

  1. Adjusts the visible area of the web page
  2. Locks the orientation of the device
  3. Controls the zoom level of the page
  4. Sets the initial scale of the webpage

Answer: 1. Adjusts the visible area of the web page

Explanation: The viewport meta tag is used in HTML5 to control the layout on mobile browsers. By default, it adjusts the width of the page to the screen width of the device.

Question 28: Which element is used in HTML5 to represent a progress of a task?

  1. <progress>
  2. <meter>
  3. <task>
  4. <loading>

Answer: 1. <progress>

Explanation: The <progress> element represents the progress of a task in HTML5.

Question 29: What is the purpose of the autofocus attribute in HTML5?

  1. Automatically focus on a form element when the page loads
  2. Auto-validate form input
  3. Automatically update content
  4. Autofill form fields based on history

Answer: 1. Automatically focus on a form element when the page loads

Explanation: The autofocus attribute is a boolean attribute that lets you specify that a form input should automatically be focused when the page loads.

Question 30: Which HTML5 tag is used to specify an ordered list?

  1. <ul>
  2. <ol>
  3. <list>
  4. <dl>

Answer: 2. <ol>

Explanation: The <ol> tag is used to define an ordered list in HTML5.

Question 31: In HTML5, which element is used to define emphasized text?

  1. <em>
  2. <i>
  3. <bold>
  4. <strong>

Answer: 1. <em>

Explanation: The <em> tag is used to define emphasized text in HTML5, which typically displays as italicized text.

Question 32: What is the default value of the type attribute for a <button> element in HTML5?

  1. button
  2. submit
  3. reset
  4. menu

Answer: 2. submit

Explanation: The default value of the type attribute for a <button> element is submit.

Question 33: Which HTML5 element is best suited for marking up a time-stamp?

  1. <datetime>
  2. <timestamp>
  3. <time>
  4. <date>

Answer: 3. <time>

Explanation: The <time> element represents a specific period in time or a time-stamp in HTML5.

Question 34: What is the purpose of the placeholder attribute in HTML5?

  1. To provide a hint to the user about what to enter in the field
  2. To pre-fill the field with default data
  3. To mark the field as a placeholder for future data
  4. To display a tooltip when hovering over the field

Answer: 1. To provide a hint to the user about what to enter in the field

Explanation: The placeholder attribute provides a hint to the user about what information to enter in the input field.

Question 35: In HTML5, which element is used to group together thematic sections of content?

  1. <group>
  2. <section>
  3. <block>
  4. <divide>

Answer: 2. <section>

Explanation: The <section> element is used in HTML5 to group together thematic sections of content.

Question 36: What does the required attribute in an input field ensure in HTML5?

  1. The field must be filled out before submitting the form
  2. The input is necessary for the form’s submission
  3. The field will be validated against pattern requirements
  4. Both 1 and 2

Answer: 4. Both 1 and 2

Explanation: The required attribute specifies that an input field must be filled out before submitting the form and is necessary for the form’s submission.

Question 37: Which HTML5 element defines a caption for a figure element?

  1. <figcaption>
  2. <caption>
  3. <title>
  4. <headline>

Answer: 1. <figcaption>

Explanation: The <figcaption> element is used to define a caption for a figure element in HTML5.

Question 38: How is a new article element indicated in HTML5?

  1. <new article>
  2. <article new>
  3. <article>
  4. <newarticle>

Answer: 3. <article>

Explanation: The <article> element is used to indicate a new article element in HTML5.

Question 39: Which HTML5 element is used for specifying metadata about an HTML document?

  1. <meta>
  2. <data>
  3. <info>
  4. <metadata>

Answer: 1. <meta>

Explanation: The <meta> tag is used in HTML5 to specify metadata about an HTML document, such as character set, page description, keywords, author of the document, and viewport settings.

Question 40: What is the purpose of the lang attribute in an HTML5 document?

  1. Specifies the programming language of the content
  2. Defines the language used in the element
  3. Indicates the language for spell checking
  4. Determines the language for text-to-speech conversion

Answer: 2. Defines the language used in the element

Explanation: The lang attribute is used to define the language used in the element, which can be important for screen readers and other assistive technologies.

Question 41: Which element in HTML5 is used to represent a control for generating a public-private key pair?

  1. <keygen>
  2. <generator>
  3. <publickey>
  4. <keypair>

Answer: 1. <keygen>

Explanation: The <keygen> element represents a control for generating a key pair (a public key and a private key) in HTML5.

Question 42: In HTML5, which element is used for displaying the result of a calculation?

  1. <calculate>
  2. <result>
  3. <output>
  4. <return>

Answer: 3. <output>

Explanation: The <output> element is used in HTML5 for representing the result of a calculation.

Question 43: Which HTML5 element is used to specify a header for a document or section?

  1. <header>
  2. <top>
  3. <heading>
  4. <head>

Answer: 1. <header>

Explanation: The <header> element is used in HTML5 to represent a container for introductory content or a set of navigational links.

Question 44: Which attribute in HTML5 specifies the character encoding for the HTML document?

  1. charset
  2. encoding
  3. character
  4. setchar

Answer: 1. charset

Explanation: The charset attribute in the <meta> tag specifies the character encoding for the HTML document.

Question 45: What does the pattern attribute in an HTML5 input field do?

  1. Specifies a regular expression the input field’s value is checked against
  2. Determines the pattern in which data is entered
  3. Creates a visual pattern in the background of the field
  4. Sets the input format for date and time fields

Answer: 1. Specifies a regular expression the input field’s value is checked against

Explanation: The pattern attribute specifies a regular expression that the <input> element’s value is checked against.

Question 46: Which HTML5 element is used to define the navigation links?

  1. <navigate>
  2. <nav>
  3. <links>
  4. <navigation>

Answer: 2. <nav>

Explanation: The <nav> element is used in HTML5 to define a set of navigation links.

Question 47: Which HTML5 element is used to specify a group of introductory or navigational aids for a page?

  1. <group>
  2. <header>
  3. <section>
  4. <intro>

Answer: 2. <header>

Explanation: The <header> element is used in HTML5 to specify a group of introductory or navigational aids for a page.

Question 48: In HTML5, what is the purpose of the data-* attribute?

  1. To store custom data private to the page or application
  2. To embed data that needs to be sent to the server
  3. To hold data about the user’s browser
  4. To store configuration settings for JavaScript libraries

Answer: 1. To store custom data private to the page or application

Explanation: The data-* attribute is used to store custom

Question 49: Which HTML5 element is specifically used for marking up a block of code?

  1. <code>
  2. <script>
  3. <block>
  4. <pre>

Answer: 1. <code>

Explanation: The <code> element is used in HTML5 to define a piece of computer code.

Question 50: Which element in HTML5 is best used for marking up a scalar measurement within a known range, like a disk usage?

  1. <gauge>
  2. <measure>
  3. <meter>
  4. <range>

Answer: 3. <meter>

Explanation: The <meter> element represents a scalar measurement within a known range, such as disk usage or the relevance of a query result.

Question 51: What does the autoplay attribute do in a <video> or <audio> element in HTML5?

  1. Automatically downloads the video or audio
  2. Automatically plays the video or audio as soon as it can do so without stopping
  3. Repeats the video or audio automatically after it’s finished
  4. Plays the video or audio in a loop

Answer: 2. Automatically plays the video or audio as soon as it can do so without stopping

Explanation: The autoplay attribute is a boolean attribute. When present, it specifies that the video or audio will start playing as soon as it is ready, without waiting for the entire file to download.

Question 52: Which HTML5 attribute specifies whether the content of an element should be editable or not?

  1. editable
  2. contenteditable
  3. modify
  4. changeable

Answer: 2. contenteditable

Explanation: The contenteditable attribute is used to specify whether the content of an element is editable or not.

Question 53: In HTML5, which element is used to define a section of content that should be independently distributable or reusable?

  1. <section>
  2. <article>
  3. <block>
  4. <content>

Answer: 2. <article>

Explanation: The <article> element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable, e.g., in syndication.

Question 54: Which HTML5 element is used for specifying a standard way to embed a video in a webpage?

  1. <movie>
  2. <media>
  3. <video>
  4. <clip>

Answer: 3. <video>

Explanation: The <video> element is used to embed video content in a document.

Question 55: What is the main function of the <figcaption> element in HTML5?

  1. To define a caption for a <figure> element
  2. To create a legend for a form control
  3. To provide a title for an image
  4. To label a diagram or illustration

Answer: 1. To define a caption for a <figure> element

Explanation: The <figcaption> element is used to define a caption for a <figure> element in HTML5.

Question 56: Which attribute is used to specify the URL of the resource to be used by the object in HTML5?

  1. src
  2. data
  3. href
  4. type

Answer: 2. data

Explanation: The data attribute is used on the <object> element to specify the URL of the resource to be used by the object.

Question 57: In HTML5, which attribute of the <textarea> element specifies the visible width of the text control?

  1. rows
  2. cols
  3. length
  4. width

Answer: 2. cols

Explanation: The cols attribute in the <textarea> element specifies the visible width of a text area.

Question 58: What is the role of the alt attribute for images in HTML5?

  1. To provide an alternative text for an image
  2. To specify the URL of the image
  3. To define a caption for the image
  4. To set the size of the image

Answer: 1. To provide an alternative text for an image

Explanation: The alt attribute provides alternative information for an image if a user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses a screen reader).

Question 59: Which HTML5 element is used to specify a header for a section or page?

  1. <header>
  2. <top>
  3. <head>
  4. <sectionhead>

Answer: 1. <header>

Explanation: The <header> element is used to represent a group of introductory or navigational aids for a page or section.

Question 60: In HTML5, which element represents a command that a user can perform or activate?

  1. <command>
  2. <button>
  3. <action>
  4. <do>

Answer: 2. <button>

Explanation: The <button> element represents a clickable button, which can be used to submit forms or anywhere in a document for accessible, standard button functionality.

Question 61: What is the correct HTML5 element for playing audio files?

  1. <sound>
  2. <audio>
  3. <mp3>
  4. <music>

Answer: 2. <audio>

Explanation: The <audio> element is used to embed sound content in documents. It can be used to play audio files.

Question 62: Which HTML5 element defines a set of navigation links?

  1. <nav>
  2. <navigate>
  3. <links>
  4. <navigation>

Answer: 1. <nav>

Explanation: The <nav> element defines a set of navigation links in HTML5.

Question 63: Which HTML5 element is used to define a part of text in an alternate voice or mood?

  1. <mark>
  2. <em>
  3. <strong>
  4. <sarcasm>

Answer: 2. <em>

Explanation: The <em> element is used to define emphasized text. The content is displayed in an italicized version of the normal font to denote a different mood or voice.

Question 64: In HTML5, which element is used to define emphasized text?

  1. <em>
  2. <i>
  3. <bold>
  4. <strong>

Answer: 1. <em>

Explanation: The <em> tag is used to define emphasized text in HTML5, which typically displays as italicized text.

Question 65: Which HTML5 element is used to represent a piece of a webpage that is independent of its surroundings?

  1. <section>
  2. <article>
  3. <aside>
  4. <block>

Answer: 2. <article>

Explanation: The <article> element represents a piece of content that is independent of its surroundings.

Question 66: Which attribute in HTML5 is used to specify that an input element should be disabled?

  1. disable
  2. inactive
  3. off
  4. disabled

Answer: 4. disabled

Explanation: The disabled attribute is a boolean attribute that indicates that the input element should be disabled.

Question 67: What is the purpose of the download attribute in the <a> tag in HTML5?

  1. To start downloading a resource when the link is clicked
  2. To link to a downloadable file
  3. To set the path for downloading files
  4. To provide a download count for the resource

Answer: 1. To start downloading a resource when the link is clicked

Explanation: The download attribute, when present, indicates that the author intends the hyperlink to be used for downloading a resource.

Question 68: Which HTML5 element is used to specify independent self-contained content?

  1. <section>
  2. <article>
  3. <aside>
  4. <block>

Answer: 2. <article>

Explanation: The <article> element is used to define independent, self-contained content.

Question 69: In HTML5, what does the async attribute in a <script> tag do?

  1. It stops the script until the page has finished parsing
  2. It runs the script asynchronously as soon as it is available
  3. It defers the script to run after the page has finished parsing
  4. It checks for syntax errors in the script

Answer: 2. It runs the script asynchronously as soon as it is available

Explanation: The async attribute in a <script> tag allows the script to be executed asynchronously as soon as it is available, without waiting for the entire page to be loaded.

Question 70: What is the purpose of the defer attribute in a <script> tag in HTML5?

  1. To delay the execution of the script until after the page has finished parsing
  2. To run the script in the background
  3. To load the script after all images have loaded
  4. To execute the script immediately

Answer: 1. To delay the execution of the script until after the page has finished parsing

Explanation: The defer attribute is a boolean attribute that indicates

Question 71: Which HTML5 element is used to define a section of a document that links to other parts of the document or to other documents?

  1. <link>
  2. <nav>
  3. <connect>
  4. <relation>

Answer: 2. <nav>

Explanation: The <nav> element is used to define a section of a document that contains navigation links to other parts of the document or to other documents.

Question 72: In HTML5, which element is used to represent data with more than one dimension?

  1. <data>
  2. <datalist>
  3. <table>
  4. <grid>

Answer: 3. <table>

Explanation: The <table> element is used to represent tabular data — that is, information presented in a two-dimensional table comprised of rows and columns of cells containing data.

Question 73: What does the controls attribute do in a <video> or <audio> element in HTML5?

  1. Adds video or audio controls like play, pause, and volume
  2. Controls the number of times the media loops
  3. Sets the default playback rate
  4. Determines the control flow of the script

Answer: 1. Adds video or audio controls like play, pause, and volume

Explanation: The controls attribute is a boolean attribute. When present, it displays controls like play, pause, and volume in the <video> or <audio> element.

Question 74: Which HTML5 element represents a list of commands?

  1. <cmd>
  2. <list>
  3. <command>
  4. <menu>

Answer: 4. <menu>

Explanation: The <menu> element represents a list of commands in HTML5.

Question 75: In HTML5, which element is used to define additional details that the user can view or hide?

  1. <details>
  2. <summary>
  3. <extra>
  4. <moreinfo>

Answer: 1. <details>

Explanation: The <details> element is used to specify additional details that the user can view or hide on demand.

Question 76: Which HTML5 element is used to define a control for entering a date (year, month, and day, with no time)?

  1. <datetime>
  2. <date>
  3. <input type=”date”>
  4. <calendar>

Answer: 3. <input type=”date”>

Explanation: The <input type=”date”> element is used to create an input field for entering a date (year, month, and day, with no time).

Question 77: What is the purpose of the for attribute in the <label> element in HTML5?

  1. To specify the form element a label is bound to
  2. To define the formatting of the label
  3. To indicate the order of label elements
  4. To determine the focus for the label

Answer: 1. To specify the form element a label is bound to

Explanation: The for attribute in the <label> element specifies which form element a label is bound to.

Question 78: In HTML5, what is the purpose of the <figcaption> element?

  1. To define a caption for a <figure> element
  2. To provide a title for a section
  3. To add a legend to a graph
  4. To label an image or illustration

Answer: 1. To define a caption for a <figure> element

Explanation: The <figcaption> element is used to define a caption for a <figure> element in HTML5.

Question 79: Which HTML5 element is used to define a container for an external application or interactive content (a plug-in)?

  1. <embed>
  2. <app>
  3. <interactive>
  4. <external>

Answer: 1. <embed>

Explanation: The <embed> element is used to define a container for an external application or interactive content, such as a web browser plug-in.

Question 80: In HTML5, which element is used to define a piece of computer code?

  1. <code>
  2. <program>
  3. <script>
  4. <computercode>

Answer: 1. <code>

Explanation: The <code> element is used to define a piece of computer code in HTML5. It is typically displayed in the browser’s default monospace font.

Question 81: What is the purpose of the autoplay attribute in HTML5 media elements like <video> and <audio>?

  1. To start playing the media automatically when the page is loaded
  2. To continuously play the media in a loop
  3. To preload the media when the page is loaded
  4. To mute the media by default

Answer: 1. To start playing the media automatically when the page is loaded

Explanation: The autoplay attribute is a boolean attribute that, when present, indicates that the media should automatically begin playback as soon as it is able to do so without stopping to finish loading the data.

Question 82: Which HTML5 element represents a thematic break between paragraph-level elements (for example, a change of scene in a story, or a shift of topic within a section)?

  1. <break>
  2. <change>
  3. <hr>
  4. <divider>

Answer: 3. <hr>

Explanation: The <hr> element represents a thematic break between paragraph-level elements, such as a change of scene in a story or a shift of topic within a section.

Question 83: What does the multiple attribute do in an <input> element in HTML5?

  1. Allows the user to enter multiple values
  2. Enables multiple selections in a dropdown list
  3. Permits multiple file uploads
  4. Both 2 and 3

Answer: 4. Both 2 and 3

Explanation: The multiple attribute is a boolean attribute that, when present, specifies that multiple values can be entered or selected in the input.

Question 84: Which HTML5 element is used to define a section in a document, such as chapters, headers, footers, or any other sections of the document?

  1. <section>
  2. <part>
  3. <division>
  4. <area>

Answer: 1. <section>

Explanation: The <section> element is used to define a section in a document.

Question 85: In HTML5, which element is used to represent a container for introductory content or a set of navigational links?

  1. <header>
  2. <intro>
  3. <navigation>
  4. <top>

Answer: 1. <header>

Explanation: The <header> element represents a container for introductory content or a set of navigational links in HTML5.

Question 86: Which HTML5 element is used for content that is tangentially related to the content around it, like a sidebar?

  1. <sidebar>
  2. <related>
  3. <aside>
  4. <tangent>

Answer: 3. <aside>

Explanation: The <aside> element is used for content that is tangentially related to the content around it, like a sidebar.

Question 87: What is the purpose of the preload attribute in a <video> or <audio> element in HTML5?

  1. To preload the entire media file
  2. To buffer enough media to start playing
  3. To load metadata of the media file
  4. To prevent the media from preloading

Answer: 2. To buffer enough media to start playing

Explanation: The preload attribute specifies if and how the author thinks that the video/audio should be loaded when the page loads. It allows buffering enough media to start playing.

Question 88: In HTML5, which attribute for the <meta> tag specifies the description of the page?

  1. content
  2. description
  3. name=”description”
  4. meta-description

Answer: 3. name=”description”

Explanation: The name=”description” attribute in the <meta> tag is used to specify the description of the page.

Question 89: Which HTML5 element represents a list of items where the order of the items is not important?

  1. <ol>
  2. <ul>
  3. <list>
  4. <items>

Answer: 2. <ul>

Explanation: The <ul> (unordered list) element represents a list of items where the order of the items is not important.

Question 90: In HTML5, which attribute of the <track> element specifies the kind of text track?

  1. type
  2. kind
  3. mode
  4. track-type

Answer: 2. kind

Explanation: The kind attribute of the <track> element specifies the kind of text track (subtitles, captions, descriptions, chapters, or metadata).

Question 91: What is the purpose of the maxlength attribute in an <input> element in HTML5?

  1. To specify the maximum length of the input value
  2. To set the maximum number of characters allowed
  3. To define the maximum value for numeric input types
  4. Both 1 and 2

Answer: 4. Both 1 and 2

Explanation: The maxlength attribute specifies the maximum length of the input value in terms of the number of characters allowed.

Question 92: Which HTML5 element is used to represent a scalar value within a known range, such as the volume control?

  1. <range>
  2. <measure>
  3. <slider>
  4. <input type=”range”>

Answer: 4. <input type=”range”>

Explanation: The <input type=”range”> element is used to represent a scalar value within a known range, such as a slider control for volume.

Question 93: In HTML5, what does the form attribute of the <button> element specify?

  1. The type of the form
  2. The action to be performed by the button
  3. The form to which the button belongs
  4. The method used by the form

Answer: 3. The form to which the button belongs

Explanation: The form attribute of the <button> element specifies the form the button belongs to, linking the button to a specific form even if it is not contained within it.

Question 94: What is the function of the placeholder attribute in HTML5 input elements?

  1. To provide a hint to the user about what kind of information is expected in the input
  2. To set a default value that is submitted with the form
  3. To display a label within the input element
  4. To store temporary data until the form is submitted

Answer: 1. To provide a hint to the user about what kind of information is expected in the input

Explanation: The placeholder attribute provides a hint to the user about what kind of information is expected in the input field, typically displayed until the user starts typing in the field.

Question 95: Which HTML5 element defines a group of media content, and is typically used with the <audio> or <video> elements?

  1. <media>
  2. <group>
  3. <source>
  4. <track>

Answer: 3. <source>

Explanation: The <source> element is used within media elements like <audio> or <video> to specify multiple media sources for different devices or browsers.

Question 96: In HTML5, which element is used to define a container for vector graphics?

  1. <svg>
  2. <vector>
  3. <graphics>
  4. <draw>

Answer: 1. <svg>

Explanation: The <svg> (Scalable Vector Graphics) element is used to define a container for vector graphics in HTML5.

Question 97: What is the purpose of the formaction attribute in an <input type=”submit”> element in HTML5?

  1. To specify the action for the form where the input element is located
  2. To override the form’s action attribute for that specific submit button
  3. To define a group of actions for form submission
  4. To specify the method of form submission

Answer: 2. To override the form’s action attribute for that specific submit button

Explanation: The formaction attribute in an <input type=”submit”> element allows you to override the action attribute of the form for that specific submit button.

Question 98: Which HTML5 element is used to define a block of text that has been quoted from another source?

  1. <blockquote>
  2. <quote>
  3. <citation>
  4. <source>

Answer: 1. <blockquote>

Explanation: The <blockquote> element is used to define a block of text that is quoted from another source.

Question 99: In HTML5, what does the nowrap attribute in a <td> element do?

  1. Prevents the text in a table cell from wrapping
  2. Automatically adjusts the width of the cell to fit the content
  3. Aligns the text to the top of the cell
  4. Stretches the cell to fit the largest item

Answer: 1. Prevents the text in a table cell from wrapping

Explanation: The nowrap attribute in a <td> (table cell) element prevents the text within the cell from wrapping.

Question 100: Which HTML5 element is used to define a header for a document or section?

  1. <head>
  2. <header>
  3. <top>
  4. <sectionhead>

Answer: 2. <header>

Explanation: The <header> element is used in HTML5 to define a header for a document or a section.