1Which HTML tag is used to create an unordered list?
A.<ol>
B.<li>
C.<ul>
D.<list>
Correct Answer: <ul>
Explanation:
The <ul> tag stands for 'unordered list' and is used to create lists where the order of items does not matter, typically displayed with bullet points.
Incorrect! Try again.
2Which attribute is used to change the numbering style in an ordered list (<ol>)?
A.order
B.class
C.style
D.type
Correct Answer: type
Explanation:
The 'type' attribute in an <ol> tag specifies the kind of marker to use, such as '1', 'A', 'a', 'I', or 'i'.
Incorrect! Try again.
3In a definition list, which tag represents the term being defined?
A.<dl>
B.<dt>
C.<dd>
D.<li>
Correct Answer: <dt>
Explanation:
The <dt> tag stands for 'definition term' and is used to define the term within a description or definition list.
Incorrect! Try again.
4Which HTML tag is used to define a list item in both ordered and unordered lists?
A.<ol>
B.<li>
C.<item>
D.<ul>
Correct Answer: <li>
Explanation:
The <li> tag stands for 'list item' and is used inside both <ul> and <ol> to define individual items.
Incorrect! Try again.
5What is the correct HTML tag for creating a hyperlink?
A.<href>
B.<link>
C.<url>
D.<a>
Correct Answer: <a>
Explanation:
The <a> tag (anchor tag) is used to define a hyperlink, which links one page to another.
Incorrect! Try again.
6Which attribute specifies the destination URL in an anchor tag?
A.dest
B.src
C.href
D.link
Correct Answer: href
Explanation:
The 'href' (Hypertext REFerence) attribute specifies the URL of the page the link goes to.
Incorrect! Try again.
7How do you make a hyperlink open in a new browser tab?
A.target="_blank"
B.target="_new"
C.tab="new"
D.window="new"
Correct Answer: target="_blank"
Explanation:
Setting the target attribute to "_blank" forces the browser to open the linked document in a new window or tab.
Incorrect! Try again.
8Which HTML tag is used to embed an image?
A.<picture>
B.<img>
C.<src>
D.<image>
Correct Answer: <img>
Explanation:
The <img> tag is used to embed an image in an HTML page. It is a self-closing tag.
Incorrect! Try again.
9The 'alt' attribute in an <img> tag is used for:
A.Specifying the image URL
B.Setting the image border
C.Aligning the image
D.Defining alternate text if the image fails to load
Correct Answer: Defining alternate text if the image fails to load
Explanation:
The 'alt' attribute provides alternative information for an image if a user cannot view it (due to slow connection, an error in the src, or usage of a screen reader).
Incorrect! Try again.
10Where should the standard favicon link be placed in an HTML document?
A.Inside the <head> tag
B.Inside the <div> tag
C.Inside the <footer> tag
D.Inside the <body> tag
Correct Answer: Inside the <head> tag
Explanation:
Favicons are defined using the <link> tag, which must be placed within the <head> section of the HTML document.
Incorrect! Try again.
11Which HTML tag is a container used to group other HTML elements and apply CSS styles to them?
A.<div>
B.<span>
C.<block>
D.<group>
Correct Answer: <div>
Explanation:
The <div> tag defines a division or a section in an HTML document and is often used as a container for other elements.
Incorrect! Try again.
12Which tag is used to display text in a subscript format (e.g., H₂O)?
A.<subscript>
B.<sub>
C.<sup>
D.<small>
Correct Answer: <sub>
Explanation:
The <sub> tag defines subscript text, which appears half a character below the normal line.
Incorrect! Try again.
13What does the <strong> tag do?
A.Underlines the text
B.Italicizes the text
C.Highlights the text
D.Defines important text, usually displayed as bold
Correct Answer: Defines important text, usually displayed as bold
Explanation:
The <strong> tag is used to define text with strong importance. The content is typically displayed in bold.
Incorrect! Try again.
14Which attribute is used to merge cells across multiple columns in a table?
A.span
B.merge
C.rowspan
D.colspan
Correct Answer: colspan
Explanation:
The 'colspan' attribute specifies the number of columns a cell should span.
Incorrect! Try again.
15Which attribute is used to merge cells across multiple rows in a table?
A.spanrow
B.rowspan
C.colspan
D.rowmerge
Correct Answer: rowspan
Explanation:
The 'rowspan' attribute specifies the number of rows a cell should span.
Incorrect! Try again.
16Which tag is used to create a table header cell?
A.<tr>
B.<th>
C.<hd>
D.<thead>
Correct Answer: <th>
Explanation:
The <th> tag defines a header cell in a table, where text is typically bold and centered by default.
Incorrect! Try again.
17Which HTML element is used to collect user input?
A.<table>
B.<div>
C.<span>
D.<form>
Correct Answer: <form>
Explanation:
The <form> element is used to create an HTML form for user input.
Incorrect! Try again.
18In a form, which attribute specifies the URL where the form data should be sent?
A.target
B.action
C.method
D.src
Correct Answer: action
Explanation:
The 'action' attribute defines the action to be performed when the form is submitted, usually sending data to a server-side script.
Incorrect! Try again.
19Which HTTP method appends form data to the URL?
A.GET
B.POST
C.PUSH
D.SEND
Correct Answer: GET
Explanation:
The GET method sends form data as URL variables (appended to the URL).
Incorrect! Try again.
20Which HTTP method should be used for sending sensitive data like passwords?
A.PUT
B.HEAD
C.GET
D.POST
Correct Answer: POST
Explanation:
The POST method sends data within the HTTP request body, making it more secure than GET for sensitive information.
Incorrect! Try again.
21Which input type is used to create a single-line text field?
A.textarea
B.text
C.line
D.textbox
Correct Answer: text
Explanation:
<input type="text"> defines a one-line text input field.
Incorrect! Try again.
22Which element is best suited for multi-line text input?
A.<input type="multi">
B.<textbox>
C.<input type="text">
D.<textarea>
Correct Answer: <textarea>
Explanation:
The <textarea> element defines a multi-line text input control.
Incorrect! Try again.
23Which input type allows the user to select multiple options from a set?
A.select
B.radio
C.button
D.checkbox
Correct Answer: checkbox
Explanation:
<input type="checkbox"> allows a user to select zero or more options of a limited number of choices.
Incorrect! Try again.
24Which input type allows the user to select exactly one option from a set?
A.checkbox
B.check
C.text
D.radio
Correct Answer: radio
Explanation:
<input type="radio"> defines a radio button, allowing the selection of only one option from a group.
Incorrect! Try again.
25How do you group radio buttons so that only one can be selected at a time?
A.Give them different 'id' values
B.Give them the same 'name' attribute
C.Give them the same 'value'
D.Put them in the same <div>
Correct Answer: Give them the same 'name' attribute
Explanation:
Radio buttons must share the same 'name' attribute to be treated as a group where only one can be selected.
Incorrect! Try again.
26Which tag is used to create a dropdown list?
A.<list>
B.<dropdown>
C.<select>
D.<input type="dropdown">
Correct Answer: <select>
Explanation:
The <select> element is used to create a drop-down list.
Incorrect! Try again.
27Which tag defines an option within a <select> list?
A.<item>
B.<li>
C.<option>
D.<choice>
Correct Answer: <option>
Explanation:
The <option> tag defines an option that can be selected in a drop-down list.
Incorrect! Try again.
28Which input type creates a button that clears all form data?
A.submit
B.clear
C.reset
D.button
Correct Answer: reset
Explanation:
<input type="reset"> defines a reset button that resets all form values to their default values.
Incorrect! Try again.
29Which input type allows users to upload a file?
A.upload
B.file
C.submit
D.text
Correct Answer: file
Explanation:
<input type="file"> defines a file-select field and a 'Browse' button for file uploads.
Incorrect! Try again.
30Which attribute is used to specify a hint that describes the expected value of an input field?
A.name
B.value
C.hint
D.placeholder
Correct Answer: placeholder
Explanation:
The placeholder attribute specifies a short hint that describes the expected value of an input field.
Incorrect! Try again.
31What tag is used to embed a video in HTML5?
A.<media>
B.<movie>
C.<embed>
D.<video>
Correct Answer: <video>
Explanation:
The <video> tag is used to embed video content in an HTML document.
Incorrect! Try again.
32Which attribute in the <video> tag displays the play/pause buttons?
A.buttons
B.controls
C.autoplay
D.loop
Correct Answer: controls
Explanation:
The 'controls' attribute adds video controls, like play, pause, and volume.
Incorrect! Try again.
33What is the purpose of the <dd> tag in a definition list?
A.Definition Date
B.Definition Data
C.Definition Divide
D.Definition Description
Correct Answer: Definition Description
Explanation:
The <dd> tag is used to describe the term (<dt>) in a definition list.
Incorrect! Try again.
34Which attribute is required for the <form> to handle file uploads?
A.method="get"
B.action="upload"
C.type="file"
D.enctype="multipart/form-data"
Correct Answer: enctype="multipart/form-data"
Explanation:
When using <input type="file">, the form's enctype attribute must be set to 'multipart/form-data'.
Incorrect! Try again.
35Which tag is used to create a clickable button?
A.<input type="button">
B.None of the above
C.<button>
D.Both A and B
Correct Answer: Both A and B
Explanation:
You can create buttons using the <button> element or the <input> element with type='button', 'submit', or 'reset'.
Incorrect! Try again.
36Which attribute pre-selects a checkbox or radio button?
A.checked
B.active
C.selected
D.on
Correct Answer: checked
Explanation:
The 'checked' attribute is a boolean attribute that specifies that an input element should be pre-selected.
Incorrect! Try again.
37Which attribute pre-selects an option in a dropdown list?
A.chosen
B.checked
C.highlighted
D.selected
Correct Answer: selected
Explanation:
The 'selected' attribute is used on an <option> tag to define which option is selected by default.
Incorrect! Try again.
38What is the correct way to create an email link?
The 'mailto:' scheme inside the href attribute creates a link that opens the user's email program.
Incorrect! Try again.
39Which tag allows you to define a table row?
A.<tr>
B.<row>
C.<td>
D.<th>
Correct Answer: <tr>
Explanation:
The <tr> tag stands for 'table row' and is used to define a row of cells in a table.
Incorrect! Try again.
40What is the default display value of a <div> element?
A.inline-block
B.block
C.none
D.inline
Correct Answer: block
Explanation:
A <div> element is a block-level element, meaning it always starts on a new line and takes up the full width available.
Incorrect! Try again.
41Which tag is used to emphasize text, usually displaying it in italics?
A.Both A and B
B.<em>
C.<i>
D.<italic>
Correct Answer: Both A and B
Explanation:
Both <i> (italic) and <em> (emphasis) usually display text in italics, though <em> carries semantic importance.
Incorrect! Try again.
42Which input type is used for fields that should be hidden from the user but sent to the server?
A.hidden
B.invisible
C.none
D.secret
Correct Answer: hidden
Explanation:
<input type="hidden"> allows developers to include data that cannot be seen or modified by users when a form is submitted.
Incorrect! Try again.
43Which attribute prevents a user from modifying the value of an input field?
A.hidden
B.stop
C.readonly
D.locked
Correct Answer: readonly
Explanation:
The 'readonly' attribute specifies that an input field is read-only (cannot be changed).
Incorrect! Try again.
44Which tag is used to play audio files?
A.<sound>
B.<mp3>
C.<audio>
D.<music>
Correct Answer: <audio>
Explanation:
The <audio> tag is used to embed sound content in documents.
Incorrect! Try again.
45Which attribute in the <audio> or <video> tag causes the media to start over again, every time it is finished?
A.loop
B.repeat
C.cycle
D.replay
Correct Answer: loop
Explanation:
The 'loop' attribute specifies that the audio or video will start over again, every time it is finished.
Incorrect! Try again.
46To create a password field where characters are masked, which input type is used?
A.mask
B.password
C.text
D.hidden
Correct Answer: password
Explanation:
<input type="password"> defines a password field where characters are masked (shown as asterisks or circles).
Incorrect! Try again.
47What is the purpose of the 'rel' attribute in a <link> tag when defining a favicon?
A.To specific the URL
B.To specify the relationship between the document and the linked file
C.To specify the image format
D.To specify the image size
Correct Answer: To specify the relationship between the document and the linked file
Explanation:
For favicons, 'rel="icon"' tells the browser that the linked file is the icon for the page.
Incorrect! Try again.
48Which element defines a standard data cell in a table?
A.<cell>
B.<tr>
C.<th>
D.<td>
Correct Answer: <td>
Explanation:
The <td> tag stands for 'table data' and defines a standard cell containing data.
Incorrect! Try again.
49Which attribute specifies the maximum number of characters allowed in an input field?
A.width
B.size
C.maxlength
D.length
Correct Answer: maxlength
Explanation:
The 'maxlength' attribute specifies the maximum number of characters allowed in the <input> element.
Incorrect! Try again.
50Which attribute forces a user to fill out an input field before submitting the form?
A.mandatory
B.validate
C.urgent
D.required
Correct Answer: required
Explanation:
The 'required' attribute is a boolean attribute that specifies that an input field must be filled out before submitting the form.
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →