JS Snippet Quiz

JS Snippet Quiz

9th - 12th Grade

8 Qs

quiz-placeholder

Similar activities

Android Studio Basic

Android Studio Basic

12th Grade

10 Qs

Client Side Scripting

Client Side Scripting

11th Grade

10 Qs

JS Practice: ITS Certification

JS Practice: ITS Certification

12th Grade

10 Qs

JavaScript & CSS & HTML

JavaScript & CSS & HTML

10th Grade

10 Qs

10-сынып HTML + CSS + JS

10-сынып HTML + CSS + JS

12th Grade

11 Qs

Grade 12- Knowledge Booster- JavaScript Events

Grade 12- Knowledge Booster- JavaScript Events

12th Grade

10 Qs

CSF U3 Networks p1

CSF U3 Networks p1

9th - 12th Grade

12 Qs

basics of javascript

basics of javascript

9th - 12th Grade

11 Qs

JS Snippet Quiz

JS Snippet Quiz

Assessment

Quiz

Computers

9th - 12th Grade

Easy

Created by

Hamzah Alnofli

Used 1+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is JavaScript used for?

Styling web pages

Making web pages interactive

Creating web page layouts

Defining web page structure

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you add JavaScript to an HTML file?

<script>

<js>

<javascript>

<code>

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to declare changing variables in JavaScript?

variable

int

var

char

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the innerHTML property do in JavaScript?

Changes the content of an element

Changes the style of an element

Removes an element from the DOM

Adds a new element to the DOM

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you select an element by its ID in JavaScript?

document.getElementByClassName()

document.getElementByName()

document.getElementById()

document.querySelector()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to add an event listener in JavaScript?

addEventListener()

attachEvent()

onEvent()

addListenEvent()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does event.preventDefault() do?

Stops the event from bubbling up the DOM tree

Prevents the default behavior of the event

Removes the event listener from the element

Stops the propagation of the event to other elements

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What would be the output in this code segment?

const x = 5;

x = 4;

console.log(x);

error

const

4

5