Font size
WorksheetsCIT JULY 2022
Total questions: 10
Worksheet time: 7mins
JavaScript is an _______ language?
Object Oriented
Object Based
Procedural
All of the above
Which of the following class in Bootstrap is used to provide a responsive fixed width container?
.container-fixed
.container-fluid
.container
All of the above
Write a JS code to print numbers from 1 to 10
Output of the following code
<p id="demo"></p> var txt1 = "Sanfoundry_"; var txt2 = "Javascriptmcq"; document.getElementById("demo").innerHTML = txt1 + txt2;
error
Sanfoundry_ Javascriptmcq
undefined
Sanfoundry_Javascriptmcq
Which of the following jQuery method is used to hide the selected elements?
The hidden() method
The hide() method
The visible(false) method
The display(none) method
The correct syntax to set the background color of all h1 elements to yellow in jQuery -
$("h1").style("background-color","yellow");
$("h1").html("background-color","yellow");
$("h1").css("background-color","yellow");
$("h1").layout("background-color","yellow");
The correct syntax for selecting the first paragraph element with id p1 is -
$("p.p1:first")
$("p#p1:first")
$("p1#p:first")
None of the above
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); } }
Prints the numbers in the array in order
Prints the numbers in the array in the reverse order
Prints 0 to the length of the array
Prints “Empty Array”
What could be the task of the statement debugger in the following JavaScript code?
It does nothing but a simple breakpoint
It debugs the error in that statement and restarts the statement's execution
It is used as a keyword that debugs the entire program at once
It is used to find error in the statement
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; }
5555
5321
531-1
531
