wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML_CSS_JAVASCRIPT

Total questions: 20

Worksheet time: 15mins

Name
Class
Date
1.

In which of the given scenarios would the Switch case be unsuitable?

a)

A conditional has to be designed whereupon Green Signal a machine has to be turned on and upon Red Signal the machine would be turned off.

b)

A conditional has to be designed in which if a number is equal to 10, then “The number is 10” is printed on the console” or else “The number is not 10” is printed on the console

c)

A conditional has to be designed in such a way that is the number is less than 100, then “The number is less than three digits” or else “The number is more than two digits”

2.

What will be the last number printed when the code below is run?


var n=2;

for (var i=n; i < 12;i=i+n){

console.log(i);

}

a)

6

b)

10

3.

Which of the following statements about the window object are true?

a)

It is a type of a local object in the browser

b)

It is a type of a global object in the browser

c)

To print the window object, we can write: console.log(window);

d)

To print the window object, we can write: console.log(this)

4.

What is the return type of the following function?


function f(x) {

return x * x;

};

a)

undefined

b)

string

c)

number

d)

function

5.

What is the data type of the variable x in this code?

var x = function(){

return 4*4;

};

a)

number

b)

undefined

c)

function

d)

boolean

6.
a)

Uncaught ReferenceError : title is not defined

“The Lords of the Rings”

b)

Uncaught ReferenceError : title is not defined

Uncaught ReferenceError : title is not defined

c)

“The Lords of the Rings”,

Uncaught ReferenceError : title is not defined

d)

“The Lords of the Rings”,

“The Lords of the Rings”

7.

a)

101 Tech

b)

101 null

c)

101 undefined

8.

What is the correct syntax to change the background color with css?

a)

background-color: purple;

b)

background-color = "purple";

c)

backgroundcolor=orange

d)

change-background-color: purple

9.

Where should you put the link tag to connect your CSS and HTML file?

a)

Between the <head> </head> in HTML

b)

Between the <body> </body> in HTML

c)

None of the above.

10.

Which of the following is the correct CSS link tag?

a)

<link rel="styles" href="stylesheet.css">

b)

<link href="stylesheet">

c)

<link rel="stylesheet" src="styles.css">

d)

<link rel="stylesheet" href="styles.css">

11.

Which of the following elements would you use to create a numbered or ordered list in an HTML document?

a)

<list>

b)

<#>

c)

<ul.

d)

<ol>

12.

Which of the following tags are formatted correctly to add an image to an HTML document?

a)

<img href="puppy.gif" alt="puppy">

b)

<img src="puppy.gif" alt="puppy">

c)

<image src="puppy.gif" alt="Puppy">

d)

<img alt="puppy">puppy.gif</img>

13.
Which of the following tags is used to create a heading within an HTML table?
a)
<h1>
b)
<head>
c)
<th>
d)
<h2>
14.

Which of the following will correctly display the words above?

a)

<h3> Eggs </h3>

<h1> Bacon </h1>

<h6> Waffles </h6>

b)

B<h1> Eggs </h1>

<h2> Bacon </h2>

<h3> Waffles </h3>

c)

<h6> Eggs </h6>

<h1> Bacon </h1>

<h3> Waffles </h3>

15.

a)

Uncaught ReferenceError: x is not defined

b)

0

c)

undefined

d)

10

16.

Which of the following functions, when called with the argument "Raju”, correctly print(s) the given output on the console?

a)

greet1

b)

greet2

c)

greet3

d)

greet4

e)

greet5

17.

Number("3")-3== 0 . What is the result?

a)

false

b)

true

c)

NaN

18.

(true + false) > 3 + true;

What is the output?

a)

false

b)

true

c)

NaN

d)

undefined

19.

12. What is the result of the following console.log([] + [] + 'java'.split(''));

a)

[] []

b)

[] [] j a v a

c)

TypeError

d)

j,a,v,a

20.

a)

Pizza

b)

Pizza's over

c)

More pizza's coming

d)

Party's over go home