JavaScript Fundamentals

JavaScript Fundamentals

8th Grade

15 Qs

quiz-placeholder

Similar activities

Tin 8. Bài 11a

Tin 8. Bài 11a

6th - 8th Grade

20 Qs

M1_Final_Quiz1_2017

M1_Final_Quiz1_2017

7th - 8th Grade

20 Qs

Creating Webpages

Creating Webpages

6th - 8th Grade

12 Qs

How To Quizzizz

How To Quizzizz

6th - 8th Grade

11 Qs

Create a Website 1

Create a Website 1

KG - University

10 Qs

BTEC Theory quiz 1: Networks and Internet

BTEC Theory quiz 1: Networks and Internet

8th - 11th Grade

16 Qs

Algorytmy

Algorytmy

8th Grade

13 Qs

Introducing HTML - One Words

Introducing HTML - One Words

8th Grade

10 Qs

JavaScript Fundamentals

JavaScript Fundamentals

Assessment

Quiz

Computers

8th Grade

Practice Problem

Hard

Created by

harshit shukla

Used 6+ times

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

1 min • 1 pt

Which of the following is not a valid primitive data type in JavaScript?

Number

String

Object

Boolean

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the correct way to declare an empty array in JavaScript?

var myArray = {};

var myArray = [];

var myArray = new Array();

Both b and c are correct

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code?

function greet(name) {

console.log("Hello, " + name + "!");

}

greet("Alice");

Hello, Alice!

function greet(name) {...}

undefined

Error

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which method is used to access a specific element in an array by its index?

getElementsByIndex

getElementAt

charAt ✅

None of the above

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How would you retrieve a reference to an HTML element with the ID "myElement" using JavaScript?

document.getElementByID("myElement");

document.getElementById("myElement");

document.querySelectorAll("#myElement");

document.getElementsByClassName("myElement");

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the difference between .innerHTML and .innerText?

.innerHTML includes HTML tags, while .innerText does not

.innerText includes HTML tags, while .innerHTML does not

There is no difference between them

.innerHTML is used for setting content, while .innerText is used for getting content

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which method is used to get the value of an attribute of an HTML element?

getAttribute()

getElementAttribute()

getAttributeValue()

None of the above

Create a free account and access millions of resources

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?

Discover more resources for Computers