Class Xii - Web (Javascript) Worksheet: Theory Questions
Class Xii - Web (Javascript) Worksheet: Theory Questions
THEORY QUESTIONS:
QUES-1: What is a constant ? Declare a constant MAX and assign the value 10.
QUES-2: Name the built-in function to be used in the following situations :
(i) To remove backslash from string.
(ii) To return number of days in a month for specified year.
QUES-3: What is the difference in ( / ) and ( % ) ?
QUES-4: When is the blur event of an element called ?
QUES-5: Identify the incorrect statement:
QUES-2: Analyse the given program segement and determine how many times the loop will
be executed. What will be the value of A after loop is terminated.
var A,B
QUES-3:
QUES-4: Write the values of c and d after execution of following code:
var a =1;
var b=2;
var c;
c=b++;
d=a++;
c++;
QUES-5:
QUES-6:
QUES-7:
QUES-7:
Predict the output of the following code.
<script type="text/javascript">
document.write("<i>Hello World!</i>");
</script>
a) HELLO WORLD
b) Hello World
c) Hello World
d) Error
QUES-8
QUES-9
PROGRAMMING QUESTIONS:
1.
2.Write a function that displays a prompt box which accepts a name and displays a greet
message ‘‘hello , Have a good day’’ when the user enters a name in a
(paragraph) which has an id ‘‘demo’’. The function header is as below :
function myfunc()
{
}
3.
4.
Write a code in JavaScript that accepts a binary number from the user and displays its
decimal equivalent number.
5. Write a code in JavaScript to accept five numbers from user, store them in an array, and
display the sorted array.
6 and 7.
8.