wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Web 102 Assessment

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

How can a developer show a pop-up message to the user?

a)

alert

b)

<input> tag

c)

console.log

d)

<p> tag

2.

Which of the following will successfully display a message to the user?

a)

Alert(Hello, user);

b)

alert("Hello, " user);

c)

Alert("Hello, user");

d)

alert("Hello, user");

3.

Which of the following will successfully display a message to the user?

a)

alert("hello, " + "user");

b)

Alert("hello, " + user);

c)

alert("hello", + "user");

d)

alert("Hello, " + user";

4.
What's the data type?
a)
String
b)
Number
5.

What's the data type for the phoneNumber variable?

a)

String

b)

Number

6.

In a <script> tag, which attribute do we need to use to link to an external JS file?

a)

src

b)

herf

c)

script

d)

filename

7.

What attribute/value do we use to make a button execute JavaScript when clicked?

a)

onclick="doSomething"

b)

on-click="doSomething"

c)

onclick="doSomething()"

d)

onclick=do Something()

8.

How do you make a button in HTML?

a)

<button>Text</button>

b)

<button text="Text"></button>

c)

<button>Text<button>

d)

<button Text>

9.

What is the syntax to declare a function called doSomething?

a)

function doSomething() { }

b)

doSomething() function { }

c)

function () doSomething { }

d)

doSomething { } function ()

10.

True or False?

a)

True

b)

False

11.

What's the Data Type?


"this is data"

a)

String

b)

Number

c)

Boolean

d)

Object

12.

What's the Data Type?


document.querySelector("p");

a)

String

b)

Number

c)

Boolean

d)

Object

13.

What's the first thing we need when defining a function?

a)

function

b)

function name

c)

parentheses

d)

call the function

14.

What do we need in order to call a function?

a)

Curly brackets

b)

Function name and parentheses

c)

alert

d)

onclick

15.

Does defining a function run any of the JavaScript code in its body?

a)

Yes

b)

No

16.

Which function do we use to create a new HTML element in JavaScript?

a)

document.querySelector

b)

document.getElementById

c)

document.appendChild

d)

document.createElement

17.

In JavaScript, how would you select an HTML input element with an ID of text?

a)

document.

selectElement("text")

b)

document.

querySelector("#input")

c)

document.

querySelector("#text")

d)

document.

getElement("text")

18.

Which message will the user see?

a)

"7 > 7"

b)

"alert"

c)

"x > 7"

d)

no message

19.

Which message will the user see?

a)

"Math is not broken"

b)

"Math is broken"

20.

Which message will the user see?

a)

The value is Banana

b)

The value is count

c)

The value is 0

d)

The value is 5