🎓 हर हाथ कंप्यूटर, हर हाथ रोज़गार

    Study Material

    O Level Web Designing Practical Questions 2026 — 15 PR-2 (M2-R5.1) Questions with Solution

    15 real O Level PR-2 web designing practical questions from the NIELIT exams of 10 and 13 February 2026 and official assignments — HTML, CSS and JavaScript solutions, questions and tips in Hindi + English, viva questions and a free practical test.

    ZK

    Zed-King Group of Institute

    Zed-King Group of Institute

    24 November 2026 20 min read 21 views
    O Level Web Designing Practical Questions 2026 — 15 PR-2 (M2-R5.1) Questions with Solution
    Free O Level Mock TestM1–M4 theory + practical papers, instant result. No fees.Start now

    Zed-King Study app · Free

    O Level students across India practise here, free

    Daily M1–M4 quizFull 100-question mocksAll-India rank
    Open the free app

    Google login · no Play Store needed

    🏆 Free All-India Sunday Mock · Sun, 29 Nov, 11 AM · CCC + O LevelRegister

    In O Level M2-R5.1 (Web Designing and Publishing), many students prepare MCQs and leave the PR-2 practical for the last week. Then, in the lab, the page does not open as expected, the JavaScript does nothing, and the 50% practical pass mark slips away.

    O Level M2 में ज़्यादातर बच्चे MCQ तैयार करते हैं और PR-2 practical आख़िरी हफ़्ते पर छोड़ देते हैं। Lab में पेज ठीक से नहीं खुलता, JavaScript काम नहीं करता — और practical के 50% पास नंबर हाथ से निकल जाते हैं। यह guide उसी के लिए है।

    This guide has 15 real PR-2 practical questions — from the NIELIT practical exams of 10 and 13 February 2026 and the official M2-R5 practical assignments — each with a complete working solution, the question in Hindi and English, and an exam tip. Every solution was checked against the same marking checks our free online PR-2 test uses, and scores 40/40.

    Zed-King Group of Institute, Kaithal is a NIELIT Study Centre (ACCR-O3292) under the Ministry of Electronics & IT, Government of India. After reading, you can type these answers in a free HTML, CSS and JavaScript editor and take the PR-2 practical mock test — the links are after the questions.


    What This Guide Covers

    Item

    Detail

    Module

    M2-R5.1 — Web Designing and Publishing

    Practical paper

    PR-2

    Questions solved

    15 — NIELIT exams of 10 Feb 2026 and 13 Feb 2026 (morning and evening) + official practical assignments

    Topics

    HTML structure · lists · forms · tables · CSS · JavaScript pop-ups, loops, Date · validation · DOM apps

    Each question has

    Question in English + Hindi · full solution · exam tip in English + Hindi

    Also inside

    Mistakes that cost marks · viva questions · free editor and practical mock test


    How the PR-2 Practical Is Judged

    Like every O Level module, the practical has to be cleared on its own at 50%. In PR-2 the examiner opens your page in the browser and looks at:

    • The page opens and works — the button does something, the form shows the result, the table looks like a table.

    • The tags the question names are really there — if it says ROWSPAN, CELLPADDING, prompt() or alert(), use exactly those.

    • Clean, readable code — proper nesting, closed tags, meaningful ids.

    • Viva — why you used a tag, what an attribute does, what happens if a field is empty.

    Examiner पहले browser में आपका पेज खोलकर देखता है कि वह चलता है या नहीं, फिर देखता है कि प्रश्न में बताए गए tag (जैसे ROWSPAN, prompt(), alert()) सच में लगे हैं या नहीं, फिर code की सफ़ाई और आख़िर में viva।

    Our free PR-2 practice test follows the exam pattern: 3 questions, attempt any 2, 40 marks each.


    Topic Map — Where the 15 Questions Come From

    Topic

    Questions

    Syllabus area

    Pure HTML — Structure, Lists, Forms and Tables

    5

    HTML basics, lists, forms, tables, CSS

    Forms + JavaScript — Read, Check and Show

    4

    JavaScript and forms, validation

    JavaScript Logic — Pop-ups, Loops and Date

    3

    JavaScript functions, loops, Date object

    Interactive Mini Apps — DOM

    3

    DOM, events, CSS

    A third of the paper is pure HTML — forms, nested lists and ROWSPAN/COLSPAN tables. These are the easiest marks, so write them without looking first. The rest needs JavaScript that reads a value, decides something and writes the result back to the page — the same three steps in almost every question.


    Pure HTML — Structure, Lists, Forms and Tables (5 questions)

    सिर्फ़ HTML · Syllabus: HTML basics, lists, forms, tables, CSS

    1. First web page

    Question: Create an HTML page with a title, one heading and two paragraphs of text. (Source: NIELIT M2-R5 Practical Assignment)

    प्रश्न: एक HTML पेज बनाइए जिसमें title, एक heading और text के दो paragraph हों।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>My First Page</title></head>
    <body>
      <h1>Welcome to ZedKing Institute</h1>
      <p>ZedKing Group of Institutions is a NIELIT Study Centre in Kaithal, Haryana.</p>
      <p>We run O Level, CCC and many other computer courses for students of all ages.</p>
    </body>
    </html>

    💡 Exam tip: Write the full skeleton — <!DOCTYPE html>, <html>, <head>, <title>, <body>. Examiners check the structure, not just the text.

    💡 टिप: पूरा ढाँचा लिखें — DOCTYPE, html, head, title, body। सिर्फ़ text लिखने से पूरे नंबर नहीं मिलते।

    2. Nested ordered list

    Question: Write HTML to show this list: 1. Coffee 2. Tea (1. Black Tea 2. Green Tea) 3. Milk — using a nested ordered list. (Source: NIELIT M2-R5 Practical Assignment)

    प्रश्न: Nested ordered list से यह output बनाइए: 1. Coffee 2. Tea (1. Black Tea 2. Green Tea) 3. Milk

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>List</title></head>
    <body>
      <ol>
        <li>Coffee</li>
        <li>Tea
          <ol>
            <li>Black Tea</li>
            <li>Green Tea</li>
          </ol>
        </li>
        <li>Milk</li>
      </ol>
    </body>
    </html>

    💡 Exam tip: The inner <ol> goes inside the Tea <li>, before its closing </li>. Putting it after </li> is the most common mistake.

    💡 टिप: अंदर वाली <ol> को Tea वाले <li> के अंदर रखें, </li> बंद होने से पहले। यही सबसे आम गलती है।

    3. Personal data entry form

    Question: Design a form for entering personal data — text field, password, email, dropdown list, radio buttons, check boxes and a submit button. (Source: NIELIT M2-R5 Practical Assignment)

    प्रश्न: Personal data भरने का form बनाइए — text field, password, email, dropdown list, radio button, check box और submit button के साथ।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>Personal Data</title></head>
    <body>
      <h2>Personal Details</h2>
      <form>
        Name: <input type="text" name="name"><br><br>
        Password: <input type="password" name="pwd"><br><br>
        Email: <input type="email" name="email"><br><br>
        Course:
        <select name="course">
          <option>O Level</option>
          <option>CCC</option>
          <option>Tally</option>
        </select><br><br>
        Gender:
        <input type="radio" name="gender" value="male"> Male
        <input type="radio" name="gender" value="female"> Female<br><br>
        Hobbies:
        <input type="checkbox" name="hobby" value="reading"> Reading
        <input type="checkbox" name="hobby" value="music"> Music<br><br>
        <input type="submit" value="Submit">
      </form>
    </body>
    </html>

    💡 Exam tip: Radio buttons of one group must share the same name — otherwise the student can tick Male and Female together.

    💡 टिप: एक group के सभी radio button का name एक जैसा रखें, वरना Male और Female दोनों एक साथ चुने जा सकते हैं।

    4. Class timetable with ROWSPAN and COLSPAN

    Question: Prepare your class timetable as a table using ROWSPAN and COLSPAN, with CELLSPACING and CELLPADDING. (Source: NIELIT M2-R5 Practical Assignment)

    प्रश्न: ROWSPAN और COLSPAN से अपनी class का timetable table में बनाइए, CELLSPACING और CELLPADDING के साथ।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>Class Timetable</title></head>
    <body>
      <h2>Class Timetable</h2>
      <table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th rowspan="2">Day</th>
          <th colspan="3">Periods</th>
        </tr>
        <tr>
          <th>9:00 - 10:00</th>
          <th>10:00 - 11:00</th>
          <th>11:00 - 12:00</th>
        </tr>
        <tr>
          <td>Monday</td>
          <td>M1 Theory</td>
          <td>M2 Web Design</td>
          <td rowspan="2">Practical Lab</td>
        </tr>
        <tr>
          <td>Tuesday</td>
          <td>M3 Python</td>
          <td>M4 IoT</td>
        </tr>
      </table>
    </body>
    </html>

    💡 Exam tip: rowspan joins cells downwards, colspan joins them sideways. In the next row, skip the cell that rowspan already covers.

    💡 टिप: rowspan नीचे की तरफ़ cells जोड़ता है, colspan बगल में। अगली row में वह cell मत लिखिए जो rowspan पहले से घेर चुका है।

    5. About my favourite sports person

    Question: Make a page titled "about my favorite sport person": the name in large purple text, milestone cities in different colours and fonts, the city of birth blinking, and a scrolling message. (Source: NIELIT PR-2 Practical Exam, 13 February 2026 (Morning))

    प्रश्न: "about my favorite sport person" title वाला पेज बनाइए: नाम बड़े बैंगनी (purple) अक्षरों में, शहर अलग-अलग रंग और font में, जन्म का शहर blink करता हुआ, और एक scrolling message।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <title>about my favorite sport person</title>
      <style>
        .blink { animation: blinker 1s linear infinite; }
        @keyframes blinker { 50% { opacity: 0; } }
      </style>
    </head>
    <body>
      <h1 style="color: purple; font-size: 48px;">Sachin Tendulkar</h1>
    
      <p style="color: red; font-family: Arial; font-style: italic;">Mumbai</p>
      <p style="color: green; font-family: Verdana; font-weight: bold;">Sharjah</p>
      <p style="color: blue; font-family: Georgia;">Chennai</p>
      <p class="blink" style="color: maroon; font-family: Courier;">Mumbai (city of birth)</p>
    
      <marquee>The highest run scorer in international cricket history.</marquee>
    </body>
    </html>

    💡 Exam tip: <blink> no longer works in any browser, so make it blink with a CSS animation. <marquee> still works and is what the question means by "scrolling text".

    💡 टिप: <blink> tag अब किसी browser में नहीं चलता — CSS animation से blink कराइए। Scrolling text के लिए <marquee> अब भी चलता है।


    Forms + JavaScript — Read, Check and Show (4 questions)

    Form + JavaScript · Syllabus: JavaScript and forms, validation

    6. Student information form

    Question: Take Student Id, Student Name, Course Name and Date of Birth for a set of students, and display the details of all students once they are entered. (Source: NIELIT PR-2 Practical Exam, 10 February 2026 (Shift 1))

    प्रश्न: कई students की Student Id, Name, Course Name और Date of Birth लीजिए, और सबकी जानकारी पेज पर दिखाइए।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>Student Information</title></head>
    <body>
      <h2>Student Information</h2>
      <form onsubmit="showStudent(event)">
        Student Id: <input type="text" id="sid"><br><br>
        Student Name: <input type="text" id="sname"><br><br>
        Course Name: <input type="text" id="course"><br><br>
        Date of Birth: <input type="date" id="dob"><br><br>
        <input type="submit" value="Add Student">
      </form>
      <div id="list"></div>
    
      <script>
        var students = [];
        function showStudent(e) {
          e.preventDefault();
          students.push({
            id: document.getElementById("sid").value,
            name: document.getElementById("sname").value,
            course: document.getElementById("course").value,
            dob: document.getElementById("dob").value
          });
          var html = "<h3>All Students</h3><table border='1'><tr><th>Id</th><th>Name</th><th>Course</th><th>DOB</th></tr>";
          for (var i = 0; i < students.length; i++) {
            var s = students[i];
            html += "<tr><td>" + s.id + "</td><td>" + s.name + "</td><td>" + s.course + "</td><td>" + s.dob + "</td></tr>";
          }
          document.getElementById("list").innerHTML = html + "</table>";
        }
      </script>
    </body>
    </html>

    💡 Exam tip: Call e.preventDefault() in the submit function — without it the page reloads and the list disappears the moment it is shown.

    💡 टिप: Submit function में e.preventDefault() ज़रूर लिखें, वरना पेज reload होकर list तुरंत गायब हो जाती है।

    7. Age authorisation page

    Question: Take a name and an age. If age is less than 18 show "<name>, you are not authorized to visit the site", otherwise "Welcome to this site". (Source: NIELIT PR-2 Practical Exam, 10 February 2026 (Shift 1))

    प्रश्न: नाम और उम्र लीजिए। उम्र 18 से कम हो तो "<नाम>, you are not authorized to visit the site" दिखाइए, वरना "Welcome to this site"।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>Age Check</title></head>
    <body>
      Name: <input type="text" id="name"><br><br>
      Age: <input type="number" id="age"><br><br>
      <button onclick="check()">Submit</button>
      <p id="msg"></p>
    
      <script>
        function check() {
          var name = document.getElementById("name").value;
          var age = parseInt(document.getElementById("age").value);
          if (age < 18) {
            document.getElementById("msg").innerHTML = name + ", you are not authorized to visit the site";
          } else {
            document.getElementById("msg").innerHTML = "Welcome to this site";
          }
        }
      </script>
    </body>
    </html>

    💡 Exam tip: .value is always text. Convert it with parseInt() before comparing with 18.

    💡 टिप: .value हमेशा text देता है — 18 से तुलना से पहले parseInt() से number बनाइए।

    8. Login page with JavaScript validation

    Question: Design a login page for an online departmental store and validate the user name and password fields with JavaScript. (Source: NIELIT PR-2 Practical Exam, 13 February 2026 (Morning))

    प्रश्न: Online departmental store का login page बनाइए और JavaScript से user name और password की validation कीजिए।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>Store Login</title></head>
    <body>
      <h2>Departmental Store Login</h2>
      <form onsubmit="return validateLogin()">
        User Name: <input type="text" id="user"><br><br>
        Password: <input type="password" id="pass"><br><br>
        <input type="submit" value="Login">
      </form>
      <p id="msg"></p>
    
      <script>
        function validateLogin() {
          var user = document.getElementById("user").value.trim();
          var pass = document.getElementById("pass").value.trim();
    
          if (user === "") {
            alert("Please enter your user name");
            return false;
          }
          if (pass === "") {
            alert("Please enter your password");
            return false;
          }
          if (pass.length < 6) {
            alert("Password must be at least 6 characters");
            return false;
          }
          document.getElementById("msg").innerHTML = "Login successful";
          return false;
        }
      </script>
    </body>
    </html>

    💡 Exam tip: Write onsubmit="return validateLogin()" — the word return is what lets false stop the form.

    💡 टिप: onsubmit में "return" लिखना ज़रूरी है — तभी false लौटाने पर form रुकता है।

    9. Simple Interest calculator

    Question: Make three text boxes for Principal, Rate and Time and an OK button that shows the Simple Interest, SI = (P × R × T) / 100, in a message box. (Source: NIELIT M2-R5 Practical Assignment)

    प्रश्न: Principal, Rate और Time के तीन text box और OK button बनाइए, जो message box में Simple Interest = (P × R × T) / 100 दिखाए।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>Simple Interest</title></head>
    <body>
      Principal: <input type="text" id="p"><br><br>
      Rate of Interest: <input type="text" id="r"><br><br>
      Duration (years): <input type="text" id="t"><br><br>
      <button onclick="calc()">OK</button>
    
      <script>
        function calc() {
          var p = parseFloat(document.getElementById("p").value);
          var r = parseFloat(document.getElementById("r").value);
          var t = parseFloat(document.getElementById("t").value);
          var si = (p * r * t) / 100;
          alert("Simple Interest = " + si);
        }
      </script>
    </body>
    </html>

    💡 Exam tip: Use parseFloat(). Without it + joins text — "1000" + "5" gives "10005".

    💡 टिप: parseFloat() लगाइए — वरना + दो text को जोड़ देता है, जैसे "1000" + "5" = "10005"।


    JavaScript Logic — Pop-ups, Loops and Date (3 questions)

    JavaScript logic · Syllabus: JavaScript functions, loops, Date object

    10. JavaScript pop-up boxes and functions

    Question: (a) A Display Date button shows the current date in a text box using onclick(). (b) Take n with prompt() and show its factorial with alert(). (Source: NIELIT PR-2 Practical Exam, 10 February 2026 (Shift 1))

    प्रश्न: (a) Display Date button दबाने पर onclick() से आज की तारीख text box में दिखे। (b) prompt() से n लेकर उसका factorial alert() में दिखाइए।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>Pop-up Boxes</title></head>
    <body>
      <button onclick="showDate()">Display Date</button>
      <input type="text" id="dateBox"><br><br>
      <button onclick="showFactorial()">Factorial</button>
    
      <script>
        function showDate() {
          document.getElementById("dateBox").value = new Date().toDateString();
        }
        function showFactorial() {
          var n = parseInt(prompt("Enter a number"));
          var f = 1;
          for (var i = 1; i <= n; i++) { f = f * i; }
          alert("Factorial of " + n + " is " + f);
        }
      </script>
    </body>
    </html>

    💡 Exam tip: Know the three pop-up boxes: alert() only shows, confirm() returns true/false, prompt() returns the typed text.

    💡 टिप: तीनों pop-up याद रखें: alert() सिर्फ़ दिखाता है, confirm() true/false देता है, prompt() टाइप किया text देता है।

    11. First n Fibonacci numbers

    Question: Take a number n with prompt() and display the first n Fibonacci numbers. (Source: NIELIT PR-2 Practical Exam, 13 February 2026 (Evening))

    प्रश्न: prompt() से n लेकर पहले n Fibonacci numbers दिखाइए।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>Fibonacci</title></head>
    <body>
      <button onclick="fib()">Show Fibonacci</button>
      <p id="out"></p>
    
      <script>
        function fib() {
          var n = parseInt(prompt("How many terms?"));
          var a = 0, b = 1, series = "";
          for (var i = 0; i < n; i++) {
            series = series + a + " ";
            var next = a + b;
            a = b;
            b = next;
          }
          document.getElementById("out").innerHTML = series;
          alert(series);
        }
      </script>
    </body>
    </html>

    💡 Exam tip: Keep a third variable (next) — if you write a = b before adding, the series goes wrong.

    💡 टिप: तीसरा variable (next) रखें — जोड़ने से पहले a = b लिख दिया तो series गलत बनेगी।

    12. Current day and time

    Question: Display the current day and time in the format: Today is: Tuesday / Current time is: 10 PM : 30 : 38 (Source: NIELIT M2-R5 Practical Assignment)

    प्रश्न: आज का दिन और समय इस format में दिखाइए: Today is: Tuesday / Current time is: 10 PM : 30 : 38

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>Day and Time</title></head>
    <body>
      <p id="out"></p>
    
      <script>
        var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
        var now = new Date();
    
        var day = days[now.getDay()];
        var h = now.getHours();
        var m = now.getMinutes();
        var s = now.getSeconds();
    
        var ampm = h >= 12 ? "PM" : "AM";
        var hour12 = h % 12;
        if (hour12 === 0) { hour12 = 12; }
    
        document.getElementById("out").innerHTML =
          "Today is: " + day + "<br>" +
          "Current time is: " + hour12 + " " + ampm + " : " + m + " : " + s;
      </script>
    </body>
    </html>

    💡 Exam tip: getDay() returns 0 for Sunday, not Monday — the days array must start with Sunday.

    💡 टिप: getDay() रविवार के लिए 0 देता है — इसलिए days array Sunday से शुरू करें।


    Interactive Mini Apps — DOM (3 questions)

    Interactive apps (DOM) · Syllabus: DOM, events, CSS

    13. Weather widget

    Question: Create a weather widget that shows a different image and message for Sunny, Rainy or Cloudy chosen by the user. (Source: NIELIT PR-2 Practical Exam, 13 February 2026 (Morning))

    प्रश्न: Weather widget बनाइए जो user के चुने Sunny, Rainy या Cloudy के हिसाब से अलग image और message दिखाए।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>Weather Widget</title></head>
    <body>
      <h2>Weather Widget</h2>
      <select id="weather">
        <option>Sunny</option>
        <option>Rainy</option>
        <option>Cloudy</option>
      </select>
      <button onclick="showWeather()">Show</button>
    
      <div id="box">
        <img id="pic" width="120" alt="weather">
        <p id="msg"></p>
      </div>
    
      <script>
        function showWeather() {
          var w = document.getElementById("weather").value;
          var pic = document.getElementById("pic");
          var msg = document.getElementById("msg");
    
          if (w === "Sunny") {
            pic.src = "sunny.png";
            msg.innerHTML = "It is a bright sunny day. Carry your sunglasses!";
          } else if (w === "Rainy") {
            pic.src = "rainy.png";
            msg.innerHTML = "Rain is expected today. Do not forget your umbrella.";
          } else if (w === "Cloudy") {
            pic.src = "cloudy.png";
            msg.innerHTML = "The sky is cloudy and the weather is pleasant.";
          }
        }
      </script>
    </body>
    </html>

    💡 Exam tip: Change the picture through img.src and the text through innerHTML in the same function, so both update on one click.

    💡 टिप: एक ही function में img.src से फोटो और innerHTML से message बदलें, ताकि एक click में दोनों बदलें।

    14. To-do list application

    Question: Create a to-do list app where the user can add tasks, delete them and mark them as completed. (Source: NIELIT PR-2 Practical Exam, 13 February 2026 (Evening))

    प्रश्न: To-do list app बनाइए जिसमें task जोड़ना, हटाना और पूरा (completed) mark करना हो।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head><meta charset="utf-8"><title>To-Do List</title></head>
    <body>
      <h2>My To-Do List</h2>
      <input type="text" id="task" placeholder="New task">
      <button onclick="addTask()">Add</button>
      <ul id="list"></ul>
    
      <script>
        function addTask() {
          var text = document.getElementById("task").value;
          if (text === "") { return; }
    
          var li = document.createElement("li");
          li.innerHTML = text + " ";
    
          var done = document.createElement("button");
          done.innerHTML = "Done";
          done.onclick = function () { li.style.textDecoration = "line-through"; };
    
          var del = document.createElement("button");
          del.innerHTML = "Delete";
          del.onclick = function () { li.remove(); };
    
          li.appendChild(done);
          li.appendChild(del);
          document.getElementById("list").appendChild(li);
          document.getElementById("task").value = "";
        }
      </script>
    </body>
    </html>

    💡 Exam tip: createElement() + appendChild() add a task, remove() deletes it, and text-decoration: line-through marks it done.

    💡 टिप: createElement() + appendChild() से task जुड़ता है, remove() से हटता है, और line-through से completed दिखता है।

    15. Country and capital selection box

    Question: Make a selection box of 5 countries; when one is selected, print its capital next to it, styled with CSS colour, bold and font size. (Source: NIELIT PR-2 Practical Exam, 13 February 2026 (Evening))

    प्रश्न: 5 देशों का selection box बनाइए; देश चुनने पर उसकी राजधानी बगल में दिखे, CSS से रंग, bold और font size के साथ।

    Solution (index.html):

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <title>Countries</title>
      <style>
        #capital {
          color: darkgreen;
          font-weight: bold;
          font-size: 24px;
        }
      </style>
    </head>
    <body>
      <select id="country" onchange="showCapital()">
        <option value="">-- Select a country --</option>
        <option value="India">India</option>
        <option value="Japan">Japan</option>
        <option value="France">France</option>
        <option value="Nepal">Nepal</option>
        <option value="Canada">Canada</option>
      </select>
    
      <span id="capital"></span>
    
      <script>
        var capitals = {
          India: "New Delhi",
          Japan: "Tokyo",
          France: "Paris",
          Nepal: "Kathmandu",
          Canada: "Ottawa"
        };
        function showCapital() {
          var c = document.getElementById("country").value;
          document.getElementById("capital").innerHTML = capitals[c] || "";
        }
      </script>
    </body>
    </html>

    💡 Exam tip: Use onchange on the <select>, not onclick — it fires only when the choice actually changes.

    💡 टिप: <select> पर onclick नहीं, onchange लगाइए — यह तभी चलता है जब सच में देश बदला जाए।


    8 Mistakes That Cost Marks in the Web Design Practical

    • Doing maths on .value directly. It is text. Use parseInt() or parseFloat() first.

    • Forgetting return in onsubmit. Without onsubmit="return check()" the form submits even when validation fails.

    • Wrong id. getElementById("Name") will not find id="name" — ids are case-sensitive.

    • Unclosed or badly nested tags. A missing or

    • breaks the whole table or list.

    • Different radio names. Radio buttons of one question must share one name.

    • Using <blink>. No browser supports it now — use a CSS animation.

    • Saving the file as .txt. In Notepad choose "All Files" and save as index.html, then open it in the browser.

    • Never testing in the browser. Open the page, click every button and try an empty field before you call the examiner.

    सबसे ज़्यादा नंबर इन गलतियों से कटते हैं: .value को सीधे जोड़ना, onsubmit में return भूलना, id की spelling (case) अलग होना, tag बंद न करना, radio का name अलग रखना, का इस्तेमाल, file को .txt में save करना, और browser में चलाकर न देखना।


    PR-2 Viva Questions With Short Answers

    • What is HTML? HyperText Markup Language — the language that gives a web page its structure.

    • What is the difference between HTML and CSS? HTML decides what is on the page; CSS decides how it looks.

    • Difference between <ol> and <ul>? <ol> is a numbered (ordered) list; <ul> is a bulleted (unordered) list.

    • What do rowspan and colspan do? rowspan merges cells vertically; colspan merges cells horizontally.

    • Difference between cellspacing and cellpadding? cellspacing is the gap between cells; cellpadding is the space inside a cell around its content.

    • Difference between GET and POST? GET sends form data in the URL; POST sends it in the request body, so it is used for passwords.

    • What are the three pop-up boxes in JavaScript? alert(), confirm() and prompt().

    • What is the DOM? Document Object Model — the page as objects that JavaScript can read and change, e.g. with getElementById().

    • Difference between == and ===? == compares values after converting types; === compares value and type both.

    • What is an event? An action such as a click or a change; onclick and onchange run a function when it happens.

    • Three ways to add CSS? Inline (style attribute), internal (<style> tag) and external (.css file with <link>).

    • What is the use of the alt attribute? It gives text for an image when the image cannot load, and is read by screen readers.


    Practise PR-2 for Free

    Reading answers is step one. Typing them against a clock is what prepares you. Everything below is free, with no login:

    Preparing for the M2 theory paper as well?

    Start the Free PR-2 Practical Test


    A Simple 2-Week Plan for the PR-2 Practical

    • Days 1–4 — Pure HTML. Questions 1 to 5. Type each from memory in Notepad, save as index.html, open in the browser.

    • Days 5–9 — Forms + JavaScript and logic. Questions 6 to 12. Change the input and predict the result before you click.

    • Days 10–14 — DOM apps and full papers. Questions 13 to 15, then one timed PR-2 practice paper every day.

    • Every day: say five viva answers out loud.

    2 हफ़्ते का plan: पहले 4 दिन सिर्फ़ HTML (प्रश्न 1–5), फिर 5 दिन Form + JavaScript (प्रश्न 6–12), आख़िरी 5 दिन DOM apps (13–15) और रोज़ एक timed practice paper। रोज़ 5 viva सवाल बोलकर दोहराएँ।


    Learn O Level at Zed-King Institute, Kaithal

    Zed-King Group of Institute is a NIELIT Study Centre — ACCR-O3292 — Ministry of Electronics & IT, Government of India, running in Kaithal since 2006. Every O Level student builds these pages on a real computer in our lab, with a teacher to fix the error on the screen.

    Course

    Fee

    Duration

    NIELIT O Level (M1–M4 with all practicals)

    ₹20,000

    1 Year

    Visit us at: Kaithal - Pundri - Karnal Rd, near New Bus Stand, opp. Hanuman Vatika, Friends Colony, Kaithal, Haryana 136027. Call +91-9416111612.

    Join O Level Course — NIELIT Study Centre, Kaithal


    Related Reading

    Tags

    #o level web designing practical questions#o level pr2 practical#m2-r5.1 practical questions#o level practical questions#html practical questions with solution#javascript practical questions#o level m2 practical#o level practical exam 2026#web designing viva questions#nielit o level kaithal

    Free for every student

    Practise before the real exam — 100% free

    O Level mock tests (M1–M4 theory and PR-1–PR-4 practical) with instant grading, plus free notes, PDFs and video classes for CCC, O Level and ECC. No fees, no registration.

    FAQ

    Frequently Asked Questions

    5 Questions

    Share this Article

    Follow ZedKing

    Stay updated on all channels

    ZedKing Courses

    Is topic ko depth mein seekhna hai?

    NIELIT & Indian Govt. certified programmes, expert faculty, aur guaranteed career support.

    Ready to Begin Your Career in Technology?

    Join Zed-King Group of Institute — Kaithal's premier Indian Govt. Authorized computer education centre. NIELIT certified since 2006.

    📍 Zed-King Group of Institute, Kaithal, Haryana — 136027

    Drag me!