OA Exams
Which HTML element is used to play audio files?
a) <audio>b) <sound>c) <media>d) <embed>
Correct Answer: a) <audio>
Explanation: The <audio> element is used to embed audio content into a webpage.
Which HTML global attribute is used to specify whether the content of an element should be editable?
a) Editableb) Contenteditablec) Data-editd) Edit
Correct Answer: b) Contenteditable
Explanation: The contenteditable attribute allows elements to be editable directly in the browser.
In HTML, which event attributes are used to handle form input?
a) Onblur and onfocusb) Onsubmit and onclickc) Onchange and onresetd) Oninput and onsubmit
Correct Answer: a) Onblur and onfocus
Explanation: The onblur and onfocus event attributes are used to handle focus events for form inputs.
Graphics defined by SVG are in which format?
a) XMLb) PNGc) JPEGd) BMP
Correct Answer: a) XML
Explanation: SVG graphics are defined using XML, which allows them to be scalable without losing quality.
Which HTML element is used to draw graphics via scripting?
a) <canvas>b) <svg>c) <img>d) <video>
Correct Answer: a) <canvas>
Explanation: The <canvas> element is used to draw graphics dynamically via JavaScript.
In HTML, which attribute is used to specify that an input field must be filled out?
a) Requiredb) Placeholderc) Valued) Type
Correct Answer: a) Required
Explanation: The required attribute makes an input field mandatory before form submission.
Which input type defines a slider control?
a) Rangeb) Sliderc) Scrolld) Progress
Correct Answer: a) Range
Explanation: The range input type allows the user to select a value from a predefined range using a slider.
Which HTML element is used to display a scalar measurement within a range?
a) <meter>b) <progress>c) <range>d) <slider>
Correct Answer: a) <meter>
Explanation: The <meter> element is used to represent scalar values within a known range, such as disk usage.
Which HTML element defines navigation links?
a) <nav>b) <header>c) <footer>d) <section>
Correct Answer: a) <nav>
Explanation: The <nav> element is used to define a section of navigation links in a webpage.
Which HTML element is used to define content aside from the main content of the page?
a) <section>b) <article>c) <aside>d) <footer>
Correct Answer: c) <aside>
Explanation: The <aside> element is used to define content related to the main content but placed to the side, like a sidebar.
Which HTML element is used to contain meta tags, links to style sheets, and the title element?
a) <meta>b) <body>c) <header>d) <head>
Correct Answer: d) <head>
Explanation: The <head> element contains metadata, links to styles, and other important non-visible content.
Which HTML declaration identifies the version of HTML used to create a webpage?
a) <head>b) <meta>c) <!DOCTYPE>d) <html>
Correct Answer: c) <!DOCTYPE>
Explanation: The <!DOCTYPE> declaration informs the browser of the HTML version being used.
Which HTML element is used to specify information about the document, such as character set or viewport?
a) <meta>b) <link>c) <head>d) <script>
Correct Answer: a) <meta>
Explanation: The <meta> element provides metadata, such as charset, author, or viewport settings for a document.
Which HTML element contains the entire document code?
a) <meta>b) <head>c) <html>d) <body>
Correct Answer: c) <html>
Explanation: The <html> element wraps all the content of an HTML document.
Which HTML element identifies the document title?
a) <meta>b) <head>c) <title>d) <header>
Correct Answer: c) <title>
Explanation: The <title> element is used to specify the title of the document, which appears in the browser tab.
Which HTML element contains all visible webpage content?
Correct Answer: d) <body>
Explanation: The <body> element contains all the visible content of a webpage.
True or False: HTML comments should be used to inform others about important elements used within webpage code.
a) Trueb) False
Correct Answer: a) True
Explanation: HTML comments (<!-- comment -->) are helpful for explaining code or giving instructions to developers.
True or False: HTML comments should be used to ensure that the addition of random whitespace will not affect rendering in browsers.
Correct Answer: b) False
Explanation: Whitespace management is handled by the browser automatically, and comments should not be used for this purpose.
True or False: HTML comments can be used to remind yourself why you inserted a particular piece of code.
Explanation: Comments are commonly used to leave notes or explanations in the code for future reference.
True or False: HTML comments can be used to disable code to see how a page will appear without a particular markup element.
Explanation: Developers often use comments to temporarily disable code and observe how the page behaves without it.