REVIEWER

REVIEWER

Assessment

Flashcard

Information Technology (IT)

University

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

39 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What will the following code display in the browser?
alert("Hello, World!");

Back

A message box with "Hello, World!"

2.

FLASHCARD QUESTION

Front

Which method is used to display a prompt box in JavaScript?

Back

alert()

3.

FLASHCARD QUESTION

Front

What is the result when the user clicks 'Cancel' in a confirm() box?

Back

false

4.

FLASHCARD QUESTION

Front

What will happen if a user enters a value in a prompt() box and clicks "OK"?

Back

The value entered will be returned as a string

5.

FLASHCARD QUESTION

Front

Which event is triggered when a user clicks a button on a webpage?

Back

onclick

6.

FLASHCARD QUESTION

Front

What is the purpose of the addEventListener() method in JavaScript?

Back

It attaches an event handler to an element.

7.

FLASHCARD QUESTION

Front

Which of the following is the correct way to call a function when a button is clicked using addEventListener()? Options: <button onclick="myFunction()">Click me</button>, button.addEventListener("click", myFunction);, <button onClick="myFunction()">Click me</button>, addEventListener("click", myFunction());

Back

button.addEventListener("click", myFunction);

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?