wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML, CSS and JavaScript

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which heading has the largest font by default?

a)

h1

b)

h2

c)

h5

d)

h6

2.

What tag do you put JavaScript code in?

a)

javascript

b)

script

c)

code

d)

body

3.

What is the name of the CSS selector to style the div tag?

a)

.div

b)

$div

c)

#div

d)

>div

e)

div

4.

What is the name of the CSS selector to style the element with id named car?

a)

.car

b)

$car

c)

#car

d)

>car

e)

car

5.

What CSS property changes the color of the font?

a)

font-color

b)

text-color

c)

background-color

d)

css-color

e)

color

6.

How do you increment the variable x by 2?

a)

x + 2;

b)

x = x + 2;

c)

x = 2;

d)

x == 2;

7.

What function will call the loop function once after a second?

a)

setTimeout(loop, 1);

b)

setTimeout(loop, 1000);

c)

setInterval(loop, 1)

d)

setInterval(loop, 1000)

8.

Given the id sprite, how do you get the element using JavaScript?

a)

document.getElementByID('sprite');

b)

document.getElementByID('#sprite');

c)

document.getElementById('sprite');

d)

document.getElementById('#sprite');

9.

Given the element ele, how do you change the element's background color to black?

a)

ele.backgroundColor('black')

b)

ele.style.backgroundColor('black')

c)

ele.background-color = 'black';

d)

ele.style.backgroundColor = 'black';

10.

What is a comment in JavaScript? Check all that apply.

a)

// This is a comment

b)

; This is a comment.

c)

# This is a comment.

d)

/* This is a comment. */