lesson3_Javascript_MCQ_&program
lesson3_Javascript_MCQ_&program
Shilpa Kate
Q2 True or false
Ans:: True
Ans:: True
10.onfocus event handler occurs which an element gets focus.
Ans: True
11.length property returns the number of characters in a string.
Ans: True
12. NaN property of number of object returns Not a Number value
Ans: True
a. condition
b.switch
c. break
d. continue
a. statement
b. .function
c. Method
d. Iteration
a. Break
b. Respond
c. continue
d. react
4. What it is necessary to skip statement block and take the control at the beginning for next
iteration ……statement is used.
a. break
b. react
c. response
d. continue
a. Next
b.New
c.Wend
d. Loop
6. An….can group data together with together with functions needed to manipulate it.
a.Method
b.Function
c. Object
d.Response
a.Objects
b.Method
c.function
d.variable
a.SRC
b. HREF
c. LINK
d. URL
9.Using ……method id property is useful for getting html element and changing its content.
a.write
b.URL
c.innerHTML
d.writeln
a.Window
b.Math
c.Array
d.String
a.open()
b.blur()
c.close()
d.focus()
a)onblur
b)onchage
c)onfocus
d)onchange
a)onblur
b)onchange
c)onfocus
d)onsubmit
a)onblur
b)onload
c)onsubmit
d) onunload
a. for…loop
b. while…loop
c. for….next
d. while…..wend
a. for(i=1;i<=5;i++) b. for(i=1,i!=4);
{ {
document.write(i); document.write(i);
} }
c. for(i=1;i<=5;i++)
document.writeln(i);
a. Src
b. head
c. URL
e. title
a. write()
b. body
c. URL
d.writeln()
a. onsubmit b. write()
c. writeln() d. onchange
7.Following properties of Number Object returns the largest minimum and maximum value
a. MIN_VALUE b. MAX_VALUE
c. toLowerCase() d. toUpperCase()
a)charAt() b)width
c)length d) trim()
****************Javascript Programs*********************
Ans:
<html>
<head>
<script type="text/javascript">
function even()
var i;
for(i=26;i<=50;i=i+2)
document.write("<br>"+i);
</script>
</head>
<body>
</body>
</html>
2.Program to display cube of any number
<!doctype html>
<html>
<head>
<script type="text/javascript">
function getcube()
var num;
num=document.getElementById("number").value;
alert(num*num*num);
</script>
</head>
<body>
<form>
</form>
</body>
</html>
3.DISPLAY MULTIPLICATION of two numbers, which were ACCEPTED from
user.
<!doctype html>
<html>
<script type="text/javascript">
var result=0;
function calc()
var n1=parseInt(f1.t1.value);
var n2=parseInt(f1.t2.value);
result=n1*n2;
document.write("<br>Multiplication is="+result);
</script>
</head>
<body>
<form name="f1">
</form>
</body>
<html>
<script type="text/javascript">
function display()
document.write("Table of 5");
document.write("<Br>");
for(i=1;i<=10;i++)
res=num*i;
document.write(num+"*"+i+"="+res+"<BR>");
</script>
<body>
<form>
</form>
</body>
</html>