wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

BT Final HTML & CSS & JS

Total questions: 25

Worksheet time: 12mins

Name
Class
Date
1.

What is a callback function in JavaScript?

a)

A function that generates random numbers

b)

A function that returns a value

c)

A function that loops through an array

d)

A function that is passed as an argument to another function

2.

When is a callback function executed?

a)

At the same time as the main function

b)

After some specific task is completed

c)

Before the main function

d)

Only on weekends

3.

Which of these is a method?

a)

getElementById( )

b)

style

c)

document

d)

color

4.

What does the 'typeof' operator in JavaScript do?

a)

Returns the data type of a variable

b)

Adds two numbers together

c)

Checks if a variable is defined

d)

Prints a message to the console

5.

What does the 'let' keyword do in JavaScript?

a)

Declares a block-scoped variable

b)

Performs a loop iteration

c)

Defines a function

d)

Prints a message to the console

6.

What is the purpose of the 'querySelector' method in JavaScript?

a)

To select the first element that matches a specified CSS selector

b)

To add a new element to the DOM

c)

To change the CSS style of an element

d)

To remove an event listener

7.

What is the purpose of the 'map' method in JavaScript?

a)

To create a new array with the results of calling a provided function on every element in the array

b)

To remove an element from an array

c)

To change the CSS style of an element

d)

To add a new element to the DOM

8.

How does the 'filter' method work in JavaScript?

a)

It creates a new array with all elements that pass the test implemented by the provided function

b)

It sorts the elements of an array

c)

It reverses the order of elements in an array

d)

It adds a new element to the beginning of an array

9.

Which CSS property is used to change the text color of an element?

a)

colour

b)

font-color

c)

text-color

d)

color

10.

What is the purpose of the 'flex' property in CSS?

a)

To control the layout of elements in a flexible way

b)

To change the font size of an element

c)

To set the background color of an element

d)

To add a border around an element

11.

Which sequence of HTML tags is correct?

a)
  1. <html><head></head><body></body></html>

b)
  1. <html><head><body></body></head></html>

c)
  1. <html><head></body></body></head></html>

d)
  1. <html><<head></head></body></body></html>

12.

What are IFrames?

a)

Buttons that link to other websites

b)

Videos uploaded to your website

c)

The number of views your website has

d)

HTML pages embedded inside of other HTML pages

13.

Which of the following will turn the h1 tag blue as the mouse hovers over it?

a)

hover > h1 {

color: blue;

}

b)

h1:hover {

color: blue;

}

c)

h1; hover {

color: blue;

}

d)

h1, hover {

color: blue;

}

14.

Which of the following defines border thickness so that the top and bottom borders are 10px thick and left and right borders are 5px thick?

a)

border: 5px 10px 5px 10px

b)

border: 5px 5px 10px 10px

c)

border: 10px 10px 5px 5px

d)

border: 10px 5px 10px 5px

15.

const fn = (a) => { a * 2 }
console.log(fn(4))

a)

8

b)

4

c)

undefined

d)

Error

16.

Javascript is _________ language.

a)

Programming

b)

Scripting

c)

Application

d)

applet

17.

What is the value of:

”41” + 1

a)

42

b)

“42”

c)

411

d)

“411”

18.

What is the name of the JavaScript standard?

a)

JavaScript

b)

ECMA Script

c)

JS

d)

PEP

19.

console.log(true+ true + true * 3)

a)

9

b)

3

c)

5

d)

NaN

20.

Which of the following is not a valid JavaScript variable name?

a)

2java

b)

_java_and_ java _names

c)

javaandjava

d)

None of the above

21.

In JavaScript the x===y statement implies that:

a)

Both x and y are equal in value, type and reference address as well.

b)

Both are x and y are equal in value only.

c)

Both are equal in the value and data type.

d)

Both are not same at all

22.

What is the output of the following code?

var city = new Array("delhi", "agra", "akot", "aligarh","palampur");

console.log(city.slice(2));

a)

[“delhi”,”agra”,”akot”]

b)

[“akot”, “aligarh”, “palampur”]

c)

[“delhi”,”agra”,”akot” , “aligarh”,”palampur”

d)

None

23.

What will be printed in the console on execution of the following JS code:

var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];

var myArr= array.filter(v => v % 3 === 0);


console.log(myArr);

a)

[3, 13]

b)

[3, 6, 9, 12, 15]

c)

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]

d)

[]

24.

var val = "JavaScript String"

console.log(val.split('a'));

a)

[ 'J', 'v', 'Script String' ]

b)

[ 'J' ,'v','Script']

c)

[ 'J', 'a', 'v', 'a', ' S', 'c', 'r', 'i', 'p', 't', 'S', 't', 'r', 'i', 'n', g' ]

d)

[ 'J', 'v', ' S', 'c', 'r', 'i', 'p', 't', 'S', 't', 'r', 'i', 'n', g' ]

25.

Find output of below Javascript addition code

console.log("1 plus 1 is " + 1 + 1);

a)

2

b)

1 plus 1 is 2

c)

1 plus 1 is 11

d)

1 plus 1 is 1 + 1