JavaScript-Day2

JavaScript-Day2

University

15 Qs

quiz-placeholder

Similar activities

Prep for Exam : Game Design Principles Set 1

Prep for Exam : Game Design Principles Set 1

University

15 Qs

ArangoDb quiz

ArangoDb quiz

University

20 Qs

Understanding Loops in C Programming

Understanding Loops in C Programming

1st Grade - University

15 Qs

Conceptos Básicos HTML5 y CSS3

Conceptos Básicos HTML5 y CSS3

University

11 Qs

PowerPoint Skills Assessment

PowerPoint Skills Assessment

8th Grade - University

10 Qs

CAEC - CH02 (1125)

CAEC - CH02 (1125)

University

20 Qs

CHAPTER 6: SYSTEM ANALYSIS AND DESIGN

CHAPTER 6: SYSTEM ANALYSIS AND DESIGN

University

14 Qs

Texto PSQ 2025 Quiz

Texto PSQ 2025 Quiz

University

10 Qs

JavaScript-Day2

JavaScript-Day2

Assessment

Quiz

Information Technology (IT)

University

Practice Problem

Hard

Created by

Chitra Muthu

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which type of loop executes at least once before checking the condition?

for loop

while loop

do-while loop

foreach loop

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What will the following code output?

for (let i = 0; i < 5; i++) {

console.log(i);

}

0 to 4

1 to 5

0 to 5

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which statement is used to exit a loop prematurely?

stop

return

break

exit

4.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What is the correct way to select an element with the ID demo?

document.getElementsByClassName('demo')

document.getElementById('demo')

document.querySelector('.demo')

document.getElementsByTagName('demo')

5.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

How can you create a new HTML element using JavaScript?

document.newElement("p")

document.appendChild("p")

document.createElement("p")

document.writeElement("p")

6.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which property is used to change the text of an HTML element?

innerText

textContent

innerHTML

All of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which method is used to remove an element from the DOM?

element.remove()

document.deleteElement()

element.destroy()

document.removeChild()

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?