Must-Know Questions & Answers
Which of the following is/are the new feature(s) of HTML5? (Select all that apply)
HTML5 introduced client-side form validation (using attributes like required, pattern, type=email) and offline storage support via localStorage, sessionStorage, and the Application Cache API.
HTML stands for __________
HTML stands for Hyper Text Markup Language — the standard markup language used to create and structure web pages.
An application that lets you search and see material on the internet is:
A Browser (e.g., Chrome, Firefox, Safari) is a software application that retrieves, renders, and lets users navigate content on the internet.
Which element is a container for all the head elements, and may include the document title, scripts, styles, meta information, and more?
The <head></head> element is a container for metadata and links to external resources like scripts, stylesheets, and meta tags. It is not displayed in the browser.
Which of the following is the most appropriate tag in HTML5 to divide a document into logical document groups?
The <section> tag in HTML5 is used to define logical sections in a document, such as chapters or thematic groupings of content. It is a semantic element unlike the generic <div>.
The following elements are newly added in HTML5: <section>, <article>, <aside>. These elements are called ___________
Semantic elements clearly describe their meaning to both the browser and the developer. Tags like <section>, <article>, <aside>, <header>, <footer>, and <nav> are all HTML5 semantic elements.
Which of the following is/are true about HTML? (Select all that apply)
In HTML5, some tags like <br>, <img>, <input> are self-closing, while others like <div>, <p> must be explicitly closed. HTML is NOT case sensitive. Browsers are lenient and attempt to render even malformed HTML without throwing errors.
If you want to change the color of a link to red when moving the mouse pointer on top of it, which CSS rule do you need?
The CSS :hover pseudo-class applies styles when the user's pointer hovers over an element. 'a:hover { color: red; }' changes the link color to red on mouseover.
Consider a date input field that shows a dropdown with specific holidays (Republic Day, May Day, Independence Day) and their dates. Which HTML code produces this?
The <datalist> element is linked to an <input> via the 'list' attribute. It provides predefined suggestions while still allowing free text entry. The <select> tag does not pair with a date input, and min/max only sets a range without labels.
Match the HTML form field to the correct input type attribute: Webaddress, PANNO, Email-id, Marital Status, Loan tenure, MobileNo
Correct mappings: Webaddress → type="url" (validates web address format), PANNO → type="text" (alphanumeric), Email-id → type="email" (validates email format), Marital Status → type="radio" (mutually exclusive options), Loan tenure → type="range" (slider), MobileNo → type="tel" (telephone number).
If the phone number should accept only 10 digit numbers, which of the following options will suit?
The 'pattern' attribute accepts a regex. [0-9]{10} matches exactly 10 digits (0–9). type="text" is correct here since 'pattern' works with text inputs. min/max only constrains numeric range, not digit count.
A textbox field should display "Only numbers are allowed" as hint text that disappears automatically when the user starts typing. Which options achieve this? (Select all that apply)
The 'placeholder' attribute displays hint text inside an input field that disappears when the user starts typing. Both type="text" and type="tel" support placeholder. Using 'value' pre-fills the field with actual text that must be manually deleted. 'default' is not a valid HTML attribute for inputs.
Ram designed a feedback portal where clicking a 'like' or 'unlike' image redirects to 'thanks.html'. Which HTML code correctly implements this?
type="image" creates a clickable image submit button that submits the form when clicked. The 'src' attribute points to the image. type="submit" doesn't use src for images, and <img> tags alone cannot submit forms.
Sita wishes to greet the user when the user clicks on a 'Greet Me' button. Which event should she use for the JavaScript code?
The 'onclick' event fires when an element (like a button) is clicked. 'onmouseclick' is not a valid event. 'onchange' fires when a field value changes. 'onmouseover' fires when the pointer moves over an element.
When you want to enclose JavaScript statements in an HTML file, which is the correct tag to use?
The <SCRIPT> tag is used to embed or reference JavaScript code in an HTML document. It can be placed in the <head> or <body> section.
Which of the below JavaScript code helps to change the content of the paragraph tag dynamically? <p id="pid1">Aim Higher.. Sky is your limit</p>
document.getElementById() retrieves an element by its id attribute. Setting .innerHTML replaces the inner content. The other options use incorrect or non-existent DOM methods.
When a user views a page containing a JavaScript program, which machine actually executes the script?
JavaScript is a client-side scripting language. It is executed by the JavaScript engine inside the user's web browser (e.g., V8 in Chrome, SpiderMonkey in Firefox) on the user's local machine.
Which of the below statements is used to write a single-line comment in a JavaScript file?
// starts a single-line comment in JavaScript. /* */ is used for multi-line block comments. <!-- --> is the HTML comment syntax and is not used inside JS files.
Which of the following operations CANNOT be done with client-side JavaScript?
Client-side JavaScript runs in the browser and has no direct access to server resources or databases. Writing to a server-side database requires server-side code (e.g., Node.js, PHP). Validation, alerts, and email sending via mailto: are achievable client-side.
Which of the below is the correct syntax for executing some code if 'amt' is equal to 5000?
if (amt == 5000) uses the equality operator (==) which checks value equality with type coercion. if (amt = 5000) is an assignment, not comparison. if (amt === "5000") uses strict equality and would fail since 5000 (number) !== "5000" (string). 'equals' is not valid JS syntax.
Based on our question bank analysis, master these concepts to score high in Web Technologies.
"Focus on understanding the logic behind pseudocode loops and selection statements, as they form the bulk of technical assessments."