Halaman

DIT Part-II Web Development Essentials Solved Paper 2026 - HTML CSS JavaScript [Part A,B,C]

DIT Part-II Web Development Essentials Solved Paper 2026 - HTML CSS JavaScript [Part A,B,C]

Web Development Essentials - DIT 2nd Term 2026 (Fully Solved). This paper covers HTML, CSS, JavaScript, Web Browser, Web Server, Search Engine, Box Model, Cookies and Forms. Complete exam-ready answers for Part-A, Part-B and Part-C are given below.

DIT, DIT Part-II, Web Development Essentials, HTML, CSS, JavaScript, DIT Solved Paper 2026, Web Browser, Web Server
Part-A a) Choose / Encircle the correct answer
i. Which tag is used to create a Hyperlink in HTML?
b) <a> - Anchor tag. Example: <a href="...">
ii. Which JS function is used to parse a string into an integer?
b) parseInt() - Correct: parseInt("123")
iii. In CSS, which property is used to change text color?
c) color - Example: p { color: red; }
iv. The # symbol in CSS is used to select by ______
c) ID - # = ID, . = Class
v. Built-in function to find highest value in JS?
c) Math.max() - Math.max(10,20,5) = 20
vi. Which HTML tag is used to specify a footer?
c) <footer>
vii. Correct syntax for JS For Loop?
c) for (let i=0; i<5; i++)
viii. Which CSS property controls space between border and contents?
b) Padding - Margin = outside, Padding = inside
ix. A Static Website is one where ______?
b) content is fixed and remains the same
x. Which protocol is used to send email?
c) SMTP - Simple Mail Transfer Protocol
Part-A b) True or False
i Javascript is a Server-side scripting language only.

False - JavaScript is primarily a client-side language. It can be used on server-side with Node.js, but not only server-side.

ii The <br> tag requires a closing tag, </br>.

False - <br> is a self-closing / void tag. It does not need </br>.

iii CSS stands for Cascading Style Sheets.

True

iv An external CSS file is linked using the <script> tag.

False - It is linked using <link> tag. Example: <link rel="stylesheet" href="style.css">. <script> is for JS.

v The prompt() function in JS is used to take input from the user.

True

Part-B - Attempt any 6 (5 Marks Each)
Q i Difference between Web Browser and Web Server

Web Browser: A software application on client side used to access and display websites. It sends requests to servers. Example: Chrome, Firefox, Edge. Web Server: A computer/software on server side that stores website files and responds to browser requests. It sends HTML, CSS, JS files back to browser. Example: Apache, Nginx. Browser = Requests, Server = Responds.

Q ii Purpose of the <form> tag in HTML

The <form> tag is used to create an interactive form to collect user input and send it to a server for processing. It can contain input fields like text boxes, password, radio buttons, checkboxes, submit button etc. Attributes: action (where to send data), method (GET / POST).

Q iii How to apply External CSS to an HTML document?

External CSS is written in a separate .css file and linked to HTML using <link> tag inside <head>.

Step 1: Create style.css
p { color: blue; }

Step 2: Link in HTML
<head>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>

This is best for maintaining large websites.

Q iv Define JavaScript variables. How do let and const differ?

A variable is a container to store data. In JS we declare it with var, let, const. let: Value can be changed/reassigned. Block scoped. Example: let age = 20; age = 21; const: Value cannot be changed after declaration. Block scoped. Must be initialized. Example: const PI = 3.14; var is old, function-scoped, avoid using it.

Q v What is the Box Model in CSS?

Box Model is the concept that every HTML element is considered as a rectangular box. Its 4 components from inside to outside: Content: The actual text/image Padding: Space between content and border (inside space) Border: Line around padding and content Margin: Space outside the border (outside space)

Formula: Total Width = Content + Padding + Border + Margin

Q vi Purpose of target="_blank" in anchor tag

In <a> tag, target="_blank" opens the linked page in a new browser tab/window instead of same tab. Example: <a href="https://google.com" target="_blank">Open Google</a>

Q vii What are cookies and why are they used?

Cookies are small text files stored by website on user's browser. Uses: Remember login sessions, Remember user preferences (language, theme), Shopping cart tracking, Analytics and tracking user behavior. They have expiry date and can be deleted.

Part-C (10 Marks Each)
Q3 What is a Search Engine? How it works and its importance?

Definition: A Search Engine is a software system designed to search information on the World Wide Web. Example: Google, Bing. How it Works (3 steps): 1) Crawling: Bots (spiders) crawl the web and collect pages. 2) Indexing: Collected pages are analyzed and stored in a huge database (index) with keywords. 3) Ranking & Retrieval: When user searches, engine finds relevant pages from index and shows them ranked by relevance using algorithms (like PageRank). Importance: Without search engines, WWW would be unusable. It helps find information in billions of pages quickly, connects users to businesses, education, and is the gateway to the internet.

Q4 Explain CSS Selectors in detail.

Selectors are used to select HTML elements to style them. 1. Universal Selector *: Selects all elements. * { margin: 0; padding: 0; } 2. Element Selector: Selects by tag name. p { color: red; } 3. ID Selector #: Selects one unique element with specific id. #header { background: black; } HTML: <div id="header"></div> 4. Class Selector .: Selects all elements with same class. Can be used multiple times. .myClass { font-size: 20px; } HTML: <p class="myClass"></p>

Q5 Write a JavaScript program using while loop to print first 10 even numbers. Also explain structure of JS function.

Program:

<script>
  let i = 1;
  let count = 0;
  while (count < 10) {
    if (i % 2 == 0) {
      document.write(i + "<br>");
      count++;
    }
    i++;
  }
</script>

Output: 2, 4, 6, 8, 10, 12, 14, 16, 18, 20

Basic Structure of a JavaScript Function: A function is a block of reusable code.
function functionName(parameter1, parameter2) { // code to be executed return result; }

Example: function sum(a, b) { return a + b; } sum(5, 10); // calling function. Parts: function keyword, name, parameters (), body {}, and optional return.

Q6 Discuss HTML tables. Explain tags <table>, <tr>, <th> and <td>.

HTML tables are used to display data in rows and columns. <table>: Defines the whole table container. <tr>: Table Row - defines a row. <th>: Table Header - defines heading cell (bold & centered). <td>: Table Data - defines normal data cell.

<table border="1">
  <tr>
    <th>Name</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Ali</td>
    <td>20</td>
  </tr>
</table>

This will create a table with 1 header row and 1 data row, 2 columns each.

Related Post

ليست هناك تعليقات