Server Side And Client Side Scripting — Part 2 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Server Side And Client Side Scripting — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which character in JavaScript code will be interpreted as XML markup?
Correct Answer: Option C — &
Detailed Academic Explanation:
If your JavaScript code contains the < or & characters, these characters are interpreted as XML markup.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which is the root element in a HTML document?
Correct Answer: Option A — HTML
Detailed Academic Explanation:
The “html” tag is the root element of any HTML document regardless of it containing a JavaScript code or not.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the code for getting the current time?
Correct Answer: Option B — var now = new Date()
Detailed Academic Explanation:
The above code determines the current time and stores it in the variable “now”.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the code to start displaying the time when document loads?
Correct Answer: Option C — window.onload = displayTime
Detailed Academic Explanation:
The above code starts displaying the time when the document loads.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
One of the main advantage of using src attribute is
Correct Answer: Option D — It simplifies the HTML files
Detailed Academic Explanation:
The main advantage of using the src attribute is that it simplifies your HTML files by allowing you to remove large blocks of JavaScript code from them—that is, it helps keep content and behavior separate.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be done if more than one page requires a file of JavaScript code?
Correct Answer: Option B — Retrives from the browser cache
Detailed Academic Explanation:
If a file of JavaScript code is shared by more than one page, it only needs to be downloaded once, by the first page that uses it—subsequent pages can retrieve it from the browser cache.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the default value of the type attribute?
Correct Answer: Option B — text/javascript
Detailed Academic Explanation:
The default value of the type attribute is “text/javascript”. You can specify this type explicitly if you want, but it is never necessary.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The language is commonly used to
Correct Answer: Option C — No longer in use
Detailed Academic Explanation:
The language attribute is deprecated and should no longer be used.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The word “document” mainly refers to
Correct Answer: Option B — Static Information
Detailed Academic Explanation:
Some pages present static information and can be called documents.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which object is the main entry point to all client-side JavaScript features and APIs?
Correct Answer: Option C — Window
Detailed Academic Explanation:
The Window object is the main entry point to all client-side JavaScript features and APIs. It represents a web browser window or frame, and you can refer to it with the identifier window.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which identifier is used to represent a web browser window or frame?
Correct Answer: Option B — window
Detailed Academic Explanation:
The Window object is the main entry point to all client-side JavaScript features and APIs. It represents a web browser window or frame, and you can refer to it with the identifier window.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which property in the Window object is used to refer to a Location object?
Correct Answer: Option D — location
Detailed Academic Explanation:
The Window object defines properties like location, which refers to a Location object that specifies the URL currently displayed in the window and allows a script to load a new URL into the window.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which Window object method is used to display message in a dialog box?
Correct Answer: Option A — alert()
Detailed Academic Explanation:
The Window object also defines methods like alert() , which displays a message in a dialog box.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The setTimeout() method is used to
Correct Answer: Option B — Register a function to be invoked after a certain time
Detailed Academic Explanation:
The setTimeout() , which registers a function to be invoked after a specified amount of time.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is a global object?
Correct Answer: Option C — Window
Detailed Academic Explanation:
In client-side JavaScript, the Window object is also the global object. This means that the Window object is at the top of the scope chain and that its properties and methods are effectively global variables and global functions.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
When will the window property come into play?
Correct Answer: Option D — Refer to window object itself
Detailed Academic Explanation:
The Window object has a property named window that always refers to itself. You can use this property if you need to refer to the window object itself, but it is not usually necessary to use window if you just want to refer to access properties of the global window object.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which is the property that represents the content displayed in the window?
Correct Answer: Option A — document
Detailed Academic Explanation:
One of the most important properties of the Window object is document: it refers to a Document object that represents the content displayed in the window.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How to pick a document element based on the value of its id attribute?
Correct Answer: Option B — getElementbyId()
Detailed Academic Explanation:
The Document object has important methods such as getElementById(), which returns a single document element (representing an open/close pair of HTML tags and all of the content between them) based on the value of its id attribute.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the property to access the first child of a node?
Correct Answer: Option D — timestamp.firstChild
Detailed Academic Explanation:
The first child of a node can be accessed using the firstChild property.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What are the properties supporting CSS styles for a document element?
Correct Answer: Option B — style and className
Detailed Academic Explanation:
Each Element object has style and className properties that allow scripts to specify CSS styles for a document element or to alter the CSS class names that apply to the element.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The style property belongs to while of the following object?
Correct Answer: Option A — Element
Detailed Academic Explanation:
Each Element object has style and className properties that allow scripts to specify CSS styles for a document element or to alter the CSS class names that apply to the element.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the event handlers in the JavaScript?
Correct Answer: Option C — Allows JavaScript code to alter the behaviour of windows
Detailed Academic Explanation:
Event handlers allow JavaScript code to alter the behavior of windows, of documents, and of the elements that make up those documents.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which handler is triggered when the content of the document in the window is stable and ready for manipulation?
Correct Answer: Option A — onload
Detailed Academic Explanation:
One of the most important event handlers is the onload handler of the Window object. It is triggered when the content of the document displayed in the window is stable and ready to be manipulated. JavaScript code is commonly wrapped within an onload event handler.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
When a program contains extensive use of event handlers, which of the following is necessary?
Correct Answer: Option B — Nested functions
Detailed Academic Explanation:
Nested functions are common in client-side JavaScript, because of its extensive use of event handlers.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the code snippet to find all container elements with class “reveal”?
Correct Answer: Option A — var elements = document.getElementsByClassName("reveal")
Detailed Academic Explanation:
The above code snippet finds all container elements with class “reveal”.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the code snippet to update the content of the timestamp element when the user clicks on it?
Correct Answer: Option B — timestamp.onclick = function() { this.innerHTML = new Date().toString(); }
Detailed Academic Explanation:
The above code snippet updates the content of the timestamp element when the user clicks on it.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is not an object?
Correct Answer: Option C — Position
Detailed Academic Explanation:
There is no object called Position.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the code snippet to change the class and let the stylesheet specify the details?
Correct Answer: Option A — timestamp.className = "highlight"
Detailed Academic Explanation:
The above code snippet changes the class and lets the stylesheet specify the details.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The libraries that build a new higher-level API for client-side programming is
Correct Answer: Option B — Framework
Detailed Academic Explanation:
Many web developers find it useful to build their web applications on top of a clientside framework library. These libraries are “frameworks” in the sense that they build a new higher-level API for client-side programming on top of the standard and proprietary APIs offered by web browsers: once you adopt a framework, your code needs to be written to use the APIs defined by that framework.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is not a framework?
Correct Answer: Option C — JavaScript
Detailed Academic Explanation:
One of the most popular frameworks is jQuery. Here, JavaScript is a scripting language and not a framework.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following frameworks focuses on DOM and Ajax utilities?
Correct Answer: Option D — Both jQueryand Prototype
Detailed Academic Explanation:
The Prototype library focuses on DOM and Ajax utilities like jQuery does, and adds quite a few core-language utilities as well.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of Dojo framework?
Correct Answer: Option B — Advertises incredible depth
Detailed Academic Explanation:
Dojo is a large framework that advertises its “incredible depth.” It includes an extensive set of UI widgets, a package system, a data abstraction layer, and more.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which is the in-house library of Yahoo!?
Correct Answer: Option B — YUI
Detailed Academic Explanation:
YUI is the in-house library of Yahoo!, and it is used on their home page.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does Dojo and YUI have in common?
Correct Answer: Option A — Facilitates DOM utilities and UI Widgets
Detailed Academic Explanation:
Like Dojo, it is a large, all-encompassing library with language utilities, DOM utilities, UI widgets, and so on. There are actually two incompatible versions of YUI, known as YUI 2 and YUI 3.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What are the two incompatible versions of YUI?
Correct Answer: Option A — YUI1 and YUI2
Detailed Academic Explanation:
Like Dojo, it is a large, all-encompassing library with language utilities, DOM utilities, UI widgets, and so on. There are actually two incompatible versions of YUI, known as YUI 2 and YUI 3.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following framework was used by Google for Gmail?
Correct Answer: Option D — YUI
Detailed Academic Explanation:
The Closure library is the client-side library that Google uses for Gmail, Google Docs, and other web applications. This library is intended to be used with the Closure compiler, which strips out unused library functions.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is a web application API framework?
Correct Answer: Option C — GWT
Detailed Academic Explanation:
GWT, the Google Web Toolkit , is a completely different kind of client-side framework. It defines a web application API in Java and provides a compiler to translate your Java programs into compatible clientside JavaScript.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which is more widely used than GWT in Google?
Correct Answer: Option A — Closure
Detailed Academic Explanation:
GWT, the Google Web Toolkit , is a completely different kind of client-side framework. It defines a web application API in Java and provides a compiler to translate your Java programs into compatible client-side JavaScript. GWT is used in some of Google’s products, but it is not as widelyused as their Closure library.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the function used to deregister event handler ‘f’?
Correct Answer: Option C — removerListener(name,f)
Detailed Academic Explanation:
removerListener(name,f) is the correct answer to “What is the function used to deregister event handler ‘f’”. This question is standard in competitive examination syllabi for Server Side And Client Side Scripting.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which is a useful way to try out small and simple Rhino programs and one-liners?
Correct Answer: Option A — Starting an interative shell
Detailed Academic Explanation:
Starting an interative shell is the correct answer to “Which is a useful way to try out small and simple Rhino programs and one-liners”. This question is standard in competitive examination syllabi for Server Side And Client Side Scripting.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.