wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CIT JULY 2022

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

 

JavaScript is an _______ language?

a)

Object Oriented

b)

Object Based

c)

Procedural

d)

All of the above

2.

Which of the following class in Bootstrap is used to provide a responsive fixed width container?

a)

.container-fixed

b)

.container-fluid

c)

.container

d)

All of the above

3.

Write a JS code to print numbers from 1 to 10

4 lines
4.

Output of the following code

<p id="demo"></p> var txt1 = "Sanfoundry_"; var txt2 = "Javascriptmcq"; document.getElementById("demo").innerHTML = txt1 + txt2;

a)

error

b)

Sanfoundry_ Javascriptmcq

c)

undefined

d)

Sanfoundry_Javascriptmcq

5.

Which of the following jQuery method is used to hide the selected elements?

a)

The hidden() method

b)

The hide() method

c)

The visible(false) method

d)

The display(none) method

6.

The correct syntax to set the background color of all h1 elements to yellow in jQuery -

a)

$("h1").style("background-color","yellow");

b)

$("h1").html("background-color","yellow");

c)

$("h1").css("background-color","yellow");

d)

$("h1").layout("background-color","yellow");

7.

The correct syntax for selecting the first paragraph element with id p1 is -

a)

$("p.p1:first")

b)

$("p#p1:first")

c)

$("p1#p:first")

d)

None of the above

8.

What will be the output of the following JavaScript code? 

function printArray(a) { var len = a.length, i = 0; if (len == 0) console.log("Empty Array"); else { do { console.log(a[i]); } while (++i < len); } }

a)

Prints the numbers in the array in order

b)

Prints the numbers in the array in the reverse order

c)

Prints 0 to the length of the array

d)

Prints “Empty Array”

9.

What could be the task of the statement debugger in the following JavaScript code?

a)

It does nothing but a simple breakpoint

b)

It debugs the error in that statement and restarts the statement's execution

c)

It is used as a keyword that debugs the entire program at once

d)

It is used to find error in the statement

10.

What will be the output of the following JavaScript code?

int size=5; int a=5; int size=4; for(int j=size;j>=0;j--) { console.log(a); a=a-2; }

a)

5555

b)

5321

c)

531-1

d)

531