wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

chatbot

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

How to add the image URL

a)

<img src=https://app.bsd.education/resources/cat.png />

b)

<img src="https://app.bsd.education/resources/cat.png" />

c)

<img src="https://app.bsd.education/resources/cat.png">

2.

One way to make a button work is to add an onclick attribute to call a JavaScript function:

a)

<button onclick="popup()">Click me!<button>

b)

<button onclick="popup()">Click me!</button>

c)

<button onclick="popup">Click me!</button>

3.

A JavaScript function is a block of code used to perform a specific action

a)

false

b)

True

4.

How to create a function ?

a)

function greetUser()

b)

function greetUser() {

}

c)

function "greetUser"() {

}

5.

In JavaScript, an alert() is a type of pop-up message box with an input field.

a)

True

b)

false

6.

How to create a prompt ?

a)

prompt(What is 2 + 2?);

b)

prompt("What is 2 + 2?");

c)

prompt("What is 2 + 2?")

7.

variable is being used to store the user's answer. This allows the program to remember what the user typed.

a)

const q1 = prompt("What is 2 + 2?")

b)

const q1 = prompt(What is 2 + 2?);

c)

const q1 = prompt("What is 2 + 2?");

8.

A JavaScript prompt() is a type of pop-up message box. It is used to display a message to the user, and users must click "OK" to close the pop-up.

a)

True

b)

False

9.

To create an alert, we use the keyword alert, a pair of parentheses, and the message we want :

a)

alert("Hello world!")

b)

alert(Hello world!);

c)

alert("Hello world!");

10.

All variables must have a unique name, followed by =, then the value we want to store to the variable.

a)

True

b)

false

11.

In JavaScript, variables are used to store and track information.

a)

const = myName "Ayesha";

b)

const myName = Ayesha;

c)

const myName = "Ayesha";

12.

To add the condition statement we used the following code ?

a)

if (today == "Monday")

b)

if (today ="Monday") { }

c)

if (today == "Monday") { }