JS Snippet Quiz

JS Snippet Quiz

9th - 12th Grade

8 Qs

quiz-placeholder

Similar activities

Pengetahuan Javascript

Pengetahuan Javascript

11th Grade

12 Qs

Review multiple choice Quiz

Review multiple choice Quiz

KG - Professional Development

10 Qs

Java Script

Java Script

9th Grade

10 Qs

Quiz Algoritmos y Front End

Quiz Algoritmos y Front End

10th Grade

10 Qs

Rec. Mat.II (Programacao)

Rec. Mat.II (Programacao)

9th - 12th Grade

10 Qs

JavaScript Review Quiz

JavaScript Review Quiz

10th Grade

13 Qs

Publishing

Publishing

11th Grade

10 Qs

Intro to JavaScript

Intro to JavaScript

9th - 12th Grade

12 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