NEW
Font size
Worksheetschatbot
Total questions: 12
Worksheet time: 6mins
How to add the image URL
<img src=https://app.bsd.education/resources/cat.png />
<img src="https://app.bsd.education/resources/cat.png" />
<img src="https://app.bsd.education/resources/cat.png">
One way to make a button work is to add an onclick attribute to call a JavaScript function:
<button onclick="popup()">Click me!<button>
<button onclick="popup()">Click me!</button>
<button onclick="popup">Click me!</button>
A JavaScript function is a block of code used to perform a specific action
false
True
How to create a function ?
function greetUser()
function greetUser() {
}
function "greetUser"() {
}
In JavaScript, an alert() is a type of pop-up message box with an input field.
True
false
How to create a prompt ?
prompt(What is 2 + 2?);
prompt("What is 2 + 2?");
prompt("What is 2 + 2?")
variable is being used to store the user's answer. This allows the program to remember what the user typed.
const q1 = prompt("What is 2 + 2?")
const q1 = prompt(What is 2 + 2?);
const q1 = prompt("What is 2 + 2?");
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.
True
False
To create an alert, we use the keyword alert, a pair of parentheses, and the message we want :
alert("Hello world!")
alert(Hello world!);
alert("Hello world!");
All variables must have a unique name, followed by =, then the value we want to store to the variable.
True
false
In JavaScript, variables are used to store and track information.
const = myName "Ayesha";
const myName = Ayesha;
const myName = "Ayesha";
To add the condition statement we used the following code ?
if (today == "Monday")
if (today ="Monday") { }
if (today == "Monday") { }
