wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JS/DOM/JQuery/HTML/CSS

Total questions: 18

Worksheet time: 14mins

Name
Class
Date
1.

jQuery is a programming language

a)

True

b)

False

2.

Which method selects the first matching element in the document?

a)

document.querySelectorAll()

b)

document.getElementsByClass()

c)

document.querySelector()

d)

document.getElementsByTagName()

3.

Which symbol does jQuery use as a shortcut for jQuery?

a)

%

b)

&

c)

.

d)

$

4.

What are the preferred (modern) coding conventions for declaring variables?

a)

const

b)

var

c)

let

d)

mkdir

5.

What is the correct syntax for string interpolation?

a)

`${}`

b)

'%{}'

c)

${}

d)

`%{}`

6.

How do you add elements into an array?

a)

.add()

b)

.push()

c)

.shift()

d)

.pop()

7.

Why would you want to use jQuery over vanilla Javascript?

a)

Because I don’t want to write double the code

b)

For easier DOM manipulation

c)

Because I like seeing $$$ signs everywhere on my screen

d)

Because I prefer chocolate JavaScript

8.

What is the correct jQuery code to set the background colour of all p elements to red?

a)

$("p").css("backgroundColor","red");

b)

$("p").layout("background-color","red");

c)

$("p").manipulate("background-color","red");

d)

$("p").css("background-color","red");

9.

Which is correct CSS syntax?

a)

{

body; color = black;

}

b)

body: color = black

c)

body {

color: black;

}

d)

{

body colour is black

}

10.

What tag do you use to create a numbered list?

a)

<list>

b)

<ol>

c)

<li>

d)

<ul>

11.

What are the correct ways to access elements in vanilla JavaScript (DOM)?

a)

document.getElementById()

b)

document.querySelector()

c)

document.grab()

d)

document.select()

12.

What language or library is the following code written in? #function{

margin-left:20px;

}

a)

JavaScript

b)

jQuery

c)

German

d)

CSS

13.

What does CSS stand for?

a)

Cascading Style Sheets

b)

Creative Style Sheets

c)

Computer Style Sheets

d)

Colourful Style Sheets

14.

Which of the following jQuery method is used to set the value of an element?

a)

val() method

b)

setValue() method

c)

content() method

d)

None of the above

15.

Inside which HTML element do we put the Javascript?

a)

js

b)

javaScript

c)

script

d)

scripting

16.

What is the meant by "this"?

a)

that

b)

depends who's asking

c)

`this` in a higher pitch

d)

the object of which the function is a property

17.

What method do you use to hide an element in jQuery?

a)

display(none) Method

b)

hidden(element) Method

c)

hide() Method

d)

visible(false) Method

18.

Which of the jQuery function prevents the code from running before the loading of the document finishes?

a)

$(document).load()

b)

$(document).unload()

c)

$(document).ready()

d)

$(document).trim()