Search Header Logo

Web L4 (Advanced)

Authored by Alaa Ahmad

Computers

6th - 8th Grade

Used 1+ times

Web L4 (Advanced)
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In this line, what is the purpose of addEventListener?

btn.addEventListener("click", function(){ ... })

To create a new element

To style the button

To run the function when the page loads

To execute a function when the button is clicked

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be printed by the following code?

let name = "Maryam";

name = "Menna";

console.log(name)

Maryam

Menna

Error

Undefined

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if you try to reassign pi in this code?

const pi = 3.14;

pi = 3.14159;

pi will change to 3.14159

It will log both values

It will throw an error

Nothing happens

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to access the type property of the laptop object?

let laptop = {

type:hp,

ram:16,

price:40000

}

laptop[type]

laptop.type

laptop->type

laptop::type

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which syntax is used to change the text color of an element with id="title" in JavaScript?

document.getElementById("title").color = "red";

document.getElementById("title").style.textColor = "red";

document.getElementById("title").style.color = "red";

document.style("title").color = "red";

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct keyword to define a function in JavaScript?

function

func

def

local

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following developer tools shows the code for the web page ?

console

Elements/inspector

network

sources

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?