NCERT Solutions for Class 11 Information Technology: Set 3 Client Side Scripting JavaScript
Explore reliable textbook solutions for Set 3 Client Side Scripting JavaScript tailored for Class 11 learners. Utilizing these Information Technology answers ensures thorough preparation and strengthens foundational knowledge before final MSBSHSE evaluations.
Practice Class 11 Information Technology Solutions: Set 3 Client Side Scripting JavaScript
Access the complete solution PDF for Class 11 Information Technology below. Regular practice with these targeted textbook answers builds familiarity with standard question patterns and helps secure higher marks in final school evaluations.
Question 1. SOP 1: Create a JavaScript program for the following using appropriate variables, JavaScript inbuilt functions, and control structures.
(i) To accept an integer and display the result by multiplying it with 3.
(ii) To accept two integers and display a larger number of them.
Answer:
(i) JavaScript program to accept an integer and display the result by multiplying it with 3:
Using the prompt() function allows us to dynamically capture user input directly from the browser window.
<!DOCTYPE html>
<html>
<head>
<title>Multiply by 3</title>
</head>
<body>
<script>
var num = parseInt(prompt("Enter an integer:"));
var result = num * 3;
document.write("The result after multiplying with 3 is: " + result);
</script>
</body>
</html>
(ii) JavaScript program to accept two integers and display the larger number:
<!DOCTYPE html>
<html>
<head>
<title>Find Larger Number</title>
</head>
<body>
<script>
var num1 = parseInt(prompt("Enter first integer:"));
var num2 = parseInt(prompt("Enter second integer:"));
if (num1 > num2) {
document.write("The larger number is: " + num1);
} else if (num2 > num1) {
document.write("The larger number is: " + num2);
} else {
document.write("Both numbers are equal.");
}
</script>
</body>
</html>
In simple words: These programs ask the user to type in numbers using a pop-up box. The first program multiplies your number by 3, while the second program compares two numbers and tells you which one is bigger.
🎯 Exam Tip: Always remember to use parseInt() when accepting numbers via prompt(), otherwise JavaScript will treat the input as text and might give incorrect results during mathematical operations.
Question 1. To check whether the user entered number is positive or negative.
Answer:
To accept integer and display the result by multiplying it with 3.
<!DOCTYPE html>
<head>
<title>To accept integer and display the result by multiplying it with 3.</title>
</head>
<body>
<script language="javascript">
var a,no,ans;
a=prompt('Enter any value');
no=parseInt(a);
ans=no*3;
document.write("The answer is :" + ans);
</script>
</body>
</html>
In simple words: This program asks the user to type in a number, converts that input into a real mathematical integer, multiplies it by 3, and then displays the final calculated answer on the screen.
🎯 Exam Tip: Always remember to use the parseInt() function when reading numbers from a prompt box, because prompt() reads everything as text by default.
Question 1. Write a JavaScript program to accept two integers and display the larger number of them.
Answer:
<!DOCTYPE html>
<head>
<title>To accept two integers and display larger number of them.</title>
</head>
<body>
<script language="javascript">
var a,b;
a=prompt('Enter first value');
b=prompt('Enter second value');
if(a>b)
document.write("a is large number than b ");
else
document.write("b is large number than a");
</script>
</body>
</html>
In simple words: This program asks the user to enter two numbers using pop-up boxes, compares them using an if-else condition, and then displays which of the two numbers is larger on the screen.
🎯 Exam Tip: Make sure to write the script tag inside the body tag and use the prompt() function correctly to accept user inputs for comparison.
Question 1. Write a JavaScript program to check whether a user-entered number is positive or negative.
Answer:
<!DOCTYPE html>
<head>
<title>To check whether, user entered number is positive or negative</title>
</head>
<body>
<script language="javascript">
var a,no;
a=prompt('Enter any number');
no=parseInt(a);
if(no>0)
document.write("Number is Positive");
else
document.write("Number is Negative");
</script>
</body>
</html>
In simple words: This program asks the user to type a number using a prompt box, converts that input into an actual number using parseInt, and then checks if it is greater than zero to display whether it is positive or negative.
🎯 Exam Tip: Always remember to use the parseInt() function to convert the string input from a prompt into an integer before performing mathematical comparisons like greater than or less than.
SOP 2: Create a JavaScript program for the following using appropriate variables, JavaScript inbuilt functions, and control structures:
(i) To accept two positive or negative numbers and check whether they are equal or not.
(ii) To accept a number and display the square of it.
(iii) To check whether the accepted integer is multiple of 3 or multiple of 7.
Answer:
Here is the complete HTML and JavaScript code to achieve the given tasks. This program uses the prompt() function to take user inputs dynamically and displays the results directly on the web page using document.write().
<!DOCTYPE html>
<html>
<head>
<title>JavaScript Program</title>
</head>
<body>
<script type="text/javascript">
// Task 1: Check if two numbers are equal
var num1 = parseFloat(prompt("Enter first number:"));
var num2 = parseFloat(prompt("Enter second number:"));
if (num1 == num2) {
document.write("The numbers " + num1 + " and " + num2 + " are equal.<br />");
} else {
document.write("The numbers " + num1 + " and " + num2 + " are not equal.<br />");
}
// Task 2: Display square of a number
var num3 = parseFloat(prompt("Enter a number to find its square:"));
var square = num3 * num3;
document.write("The square of " + num3 + " is: " + square + "<br />");
// Task 3: Check if multiple of 3 or 7
var num4 = parseInt(prompt("Enter an integer:"));
if (num4 % 3 == 0 || num4 % 7 == 0) {
document.write(num4 + " is a multiple of 3 or 7.<br />");
} else {
document.write(num4 + " is not a multiple of 3 or 7.<br />");
}
</script>
</body>
</html>
In simple words: This program asks the user to type in numbers, then uses simple math rules to check if they are equal, calculates their square by multiplying the number by itself, and checks if they can be divided perfectly by 3 or 7.
🎯 Exam Tip: Always use the prompt() function to accept user inputs and remember to use the modulo operator (%) to check for multiples of a number.
Question 1. Write a JavaScript program to accept two numbers from the user and check whether they are equal or not.
Answer: The following code prompts the user to enter two numbers and displays whether they are equal. This program uses simple conditional statements to compare the user inputs.<!DOCTYPE html>
<head>
<title>program3</title>
</head>
<body>
<script language="javascript"> var no1,no2;
no1=prompt('Enter first number');
no2=prompt('Enter Second number');
if(no1==no2)
document.write("Both are equal");
else
document.write("Given numbers are not equal");
</script>
</body>
</html>
In simple words: This program asks the user to type in two numbers using prompt boxes, compares them, and prints whether they are equal or not on the screen.
🎯 Exam Tip: Always remember to use the double equal sign (==) for comparison in JavaScript, as a single equal sign (=) is used for assigning values.
Question 1. Write an HTML and JavaScript program to accept a number and display the square of it.
Answer:<!DOCTYPE html>
<html>
<head>
<title>To accept number and display square of it</title>
</head>
<body>
<script language="javascript">
var no,sqr;
no=prompt('Enter Any number');
sqr=no*no;
document.write("The Square is=" + sqr);
</script>
</body>
</html>
In simple words: This program asks the user to type a number using a pop-up box, multiplies that number by itself to find the square, and then displays the result on the screen.
🎯 Exam Tip: Always remember to use the prompt() function to accept input from the user and document.write() to display the output on the webpage.
Question 1. Write a program to check whether the accepted integer is multiple of 3 or multiple of 7.
Answer:
<!DOCTYPE html>
<html>
<head>
<title>To check whether the accepted integer is multiple of 3 or multiple of 7.</title>
</head>
<body>
<script language="JavaScript">
var a;
a = prompt("Enter your first integer / number");
if (a % 3 == 0 || a % 7 == 0)
alert("multiple of 3 or 7");
else
alert("not a multiple of 3 or 7");
</script>
</body>
</html>
This script uses the prompt function to take user input dynamically when the webpage loads.
In simple words: This program asks the user to type a number, and then checks if that number can be divided by 3 or 7 without leaving any remainder. It then displays a message box with the result.
🎯 Exam Tip: Always ensure that you use the double equals sign (==) for comparison and the double vertical bar (||) for the logical OR operator in JavaScript conditions.
Question SOP 3. Create a JavaScript program for the following using appropriate variables, JavaScript inbuilt string functions, and control structures:
(i) To accept a string and calculate its length.
(ii) To accept a string and display it in lowercase and uppercase.
(iii) To check whether the length of the string is 4 or greater.
Answer:
To accept a string and calculate its length.
<!DOCTYPE html>
<head>
<title>program8</title>
</head>
<body>
<script language="javascript">
var a;
a=prompt('Enter string');
document.write("The length is="+a.length);
</script>
This script prompt allows users to input any text and dynamically displays its character count.
In simple words: This program asks the user to type in some text, and then it counts and displays how many characters are in that text.
🎯 Exam Tip: When writing JavaScript inside HTML, always ensure your script tags are correctly opened and closed, and use the .length property to find the size of a string.
Question 1. Write a HTML and JavaScript program to accept a string and display it in lowercase and uppercase.
Answer:
<!DOCTYPE html>
<head>
<title> To accept string and display it into lowercase and uppercase</title>
</head>
<body>
<script language="javascript">
var a;
a=prompt('Enter any string');
document.write("<br>Entering Strings "+a);
document.write("<br>Lowercase="+a.toLowerCase());
document.writeln("<br>Uppercase="+a.toUpperCase());
</script>
</body>
</html>
This script uses the prompt() function to take user input dynamically and processes it using built-in string methods.
In simple words: This program asks the user to type in any text. It then displays the original text, followed by the same text converted entirely into small letters (lowercase) and capital letters (uppercase).
🎯 Exam Tip: Always remember that JavaScript is case-sensitive. Ensure you write methods like toLowerCase() and toUpperCase() with correct camelCase to avoid runtime errors.
Question 1. Write a JavaScript program to check whether the length of string is 4 or greater.
Answer: This script uses the prompt function to capture user input dynamically and check its length.
<!DOCTYPE html>
<html>
<head>
<title> JavaScript</title>
</head>
<body>
<script language=JavaScript>
var a,b;
a=prompt(“Enter your text”);
b=a.length;
if(b=4 || b>=4)
alert(‘‘your length is 4 or greater”);
else
alert(“your text length is below 4”);
</script>
</body>
</html>
In simple words: This program asks the user to type some text, counts how many characters are in it, and then displays a message showing whether the text has 4 or more characters.
🎯 Exam Tip: Always remember to close your HTML and script tags properly, and pay attention to comparison operators in conditional statements to ensure correct logic.
Question. SOP 4: Create event-driven JavaScript programs for the following using appropriate variables, JavaScript inbuilt functions, and control structures.
(i) To accept numbers and validate if the given value is a number or not by clicking on the button.
(ii) To calculate the addition and division of two numbers.
Answer: These event-driven scripts run directly in the web browser to provide instant feedback to the user.
(i) HTML and JavaScript code to validate if the input is a number:
<!DOCTYPE html>
<html>
<head>
<title>Number Validation</title>
<script type="text/javascript">
function validate() {
var val = document.getElementById("num").value;
if (val == "") {
alert("Please enter a value");
} else if (isNaN(val)) {
alert("The given value is NOT a number");
} else {
alert("The given value is a number");
}
}
</script>
</head>
<body>
<form>
Enter Value:- <input type="text" id="num" />
<input type="button" value="Check" onclick="validate()" />
</form>
</body>
</html>
(ii) HTML and JavaScript code to calculate addition and division:
<!DOCTYPE html>
<html>
<head>
<title>Addition and Division</title>
<script type="text/javascript">
function add() {
var n1 = parseFloat(document.getElementById("num1").value);
var n2 = parseFloat(document.getElementById("num2").value);
var res = n1 + n2;
alert("Addition: " + res);
}
function divide() {
var n1 = parseFloat(document.getElementById("num1").value);
var n2 = parseFloat(document.getElementById("num2").value);
if (n2 == 0) {
alert("Division by zero is not allowed");
} else {
var res = n1 / n2;
alert("Division: " + res);
}
}
</script>
</head>
<body>
<form>
1st Number: <input type="text" id="num1" /><br /><br />
2nd Number: <input type="text" id="num2" /><br /><br />
<input type="button" value="Addition" onclick="add()" />
<input type="button" value="Divide" onclick="divide()" />
</form>
</body>
</html>
In simple words: These JavaScript programs help us check if a user has entered a valid number and perform basic math operations like addition and division when buttons are clicked.
🎯 Exam Tip: Always use the inbuilt isNaN() function to check if a value is not a number, and remember to convert text inputs to numbers using parseFloat() or parseInt() before performing arithmetic operations.
Question. Write an HTML program with JavaScript to accept a value from the user and check whether it is a number or a string.
Answer:
<html>
<head>
<title>Check Value</title>
<script language="JavaScript">
function display()
{
var a;
a = form1.t1.value;
if (a >= 0)
alert("Value is a number " + a);
else
alert("Value is a string " + a);
}
</script>
</head>
<body>
<form name="form1">
Enter Value: <input type="text" name="t1"><br><br>
<input type="button" value="Check" onClick="display()">
</form>
</body>
</html>
In simple words: This code creates a text box where you can type anything. When you click the button, JavaScript checks if your input is a number or text and shows a pop-up message with the result.
🎯 Exam Tip: Always remember to close all HTML tags properly and ensure your JavaScript function name matches the one called in the button's onClick event.
Question 1. Write a HTML and JavaScript program to calculate the addition and division of two numbers.
Answer:
The following code demonstrates how to perform addition and division operations using JavaScript functions. This script uses basic functions to retrieve values from a form and perform arithmetic operations.
<!DOCTYPE html>
<head>
<title>To calculate addition and division of two numbers.</title>
<script language="javascript">
function add()
{
var a,b,result;
a=f1.t1.value;
b=f1.t2.value;
result=parseInt(a)+parseInt(b);
document.write("The Addition is ="+result);
}
function div()
{
var a,b,d;
a=f1.t1.value;
b=f1.t2.value;
d=parseInt(a)/parseInt(b);
document.write("The Divide is ="+d);
}
</script>
</head>
In simple words: This program takes two numbers entered by the user, converts them from text into actual numbers, and then either adds them together or divides one by the other when the respective function is called.
🎯 Exam Tip: Always remember to use parseInt() to convert text input values into numbers before performing mathematical addition, otherwise JavaScript will concatenate them as strings.
HTML Form Implementation for Addition and Division
</script>
</head>
<body>
<form name="f1">
1st Number : <input type="text" name="t1"><br>
2nd Number : <input type="text" name="t2"><br>
<input type="button" value="Addition" name="b1" onClick="add()">
<input type="button" value="Division" name="b2" onClick="div()">
</form>
</body>
</html>
🎯 Exam Tip: When designing forms in HTML for JavaScript practicals, ensure the onClick event handler names match the exact function names defined in your script block (case-sensitive).
Free study material for Information Technology
MSBSHSE Solutions for Class 11 Information Technology Set 3 Client Side Scripting JavaScript
Chapter Exercise Answers for Class 11 Information Technology
Access structured MSBSHSE textbook solutions for Set 3 Client Side Scripting JavaScript. Designed in alignment with the latest academic curriculum for Class 11 Information Technology, these answers cover all end-of-chapter exercises to support daily learning and homework completion.
Detailed Answer Guides for Set 3 Client Side Scripting JavaScript
Beyond providing final answers, these guides offer step-by-step breakdowns for complex queries in the Class 11 Information Technology module. This approach helps students balance theoretical depth with practical problem-solving skills required for MSBSHSE exams.
Complete Preparation Kit for Class 11 Exams
These resources act as an effective roadmap for daily homework tasks and independent study. Supplement your review of Set 3 Client Side Scripting JavaScript with official sample papers and interactive practice tests available on our platform free of charge.
FAQs
The complete and updated Maharashtra Board Class 11 Information Technology Set 3 Client Side Scripting JavaScript Solutions is available for free on StudiesToday.com. These solutions for Class 11 Information Technology are as per latest MSBSHSE curriculum.
Yes, our experts have revised the Maharashtra Board Class 11 Information Technology Set 3 Client Side Scripting JavaScript Solutions as per 2026 exam pattern. All textbook exercises have been solved and have added explanation about how the Information Technology concepts are applied in case-study and assertion-reasoning questions.
Toppers recommend using MSBSHSE language because MSBSHSE marking schemes are strictly based on textbook definitions. Our Maharashtra Board Class 11 Information Technology Set 3 Client Side Scripting JavaScript Solutions will help students to get full marks in the theory paper.
Yes, we provide bilingual support for Class 11 Information Technology. You can access Maharashtra Board Class 11 Information Technology Set 3 Client Side Scripting JavaScript Solutions in both English and Hindi medium.
Yes, you can download the entire Maharashtra Board Class 11 Information Technology Set 3 Client Side Scripting JavaScript Solutions in printable PDF format for offline study on any device.