Search Header Logo

JavaScript DOM Manipulation Quiz

Authored by Sáng Nguyễn

Computers

12th Grade

JavaScript DOM Manipulation Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What method adds specified class(es) to the classList of an element?

remove(classname)

add(classname)

toggle(classname)

contains(classname)

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method removes a specified class from an element's classList?

add(classname)

remove(classname)

toggle(classname)

replace(oldclass, newclass)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the toggle(classname) method do?

Both adds and removes a class

Removes a class from the list

Replaces a class in the list

Adds a class to the list

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the contains(classname) method return?

True if the class is present

False if the class is present

The class name

An error if the class is not found

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to create a new DOM element?

document.removeChild()

document.insertBefore()

document.appendChild()

document.createElement()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does parent.appendChild(node) do?

Removes a child node

Adds a node at the end of the child list

Inserts a node before another

Replaces a child node

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method removes a node from the DOM?

parent.replaceChild(new, old)

parent.insertBefore(new, old)

parent.removeChild(node)

node.remove()

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?