JavaScript Basics Quiz

JavaScript Basics Quiz

University

20 Qs

quiz-placeholder

Similar activities

Nesc E01001 pratice test 2

Nesc E01001 pratice test 2

University

19 Qs

Practical test

Practical test

University

15 Qs

AMT10503 (24-25) Quiz 2

AMT10503 (24-25) Quiz 2

University

20 Qs

Post-test in AL 2

Post-test in AL 2

University

20 Qs

LEARNING & TEACHING

LEARNING & TEACHING

University - Professional Development

20 Qs

Educational Assessment- KBAT Version

Educational Assessment- KBAT Version

University

20 Qs

Data Structures-Quiz-2

Data Structures-Quiz-2

University

20 Qs

GMI Networking- CCNA4: Chapter 5

GMI Networking- CCNA4: Chapter 5

University

22 Qs

JavaScript Basics Quiz

JavaScript Basics Quiz

Assessment

Quiz

Education

University

Medium

Created by

Rw8 Sodvadiya

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to declare a variable in JavaScript?

dim

declare

var

int

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write “Hello World” in an alert box?

alertBox("Hello World");

msgBox("Hello World");

alert("Hello World");

msg("Hello World");

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to output "Hi" to the browser console?

print("Hi")

console.print("Hi")

console.log("Hi")

log.console("Hi")

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is a correct JavaScript data type?

integer

decimal

object

real

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of `2 + "2"` in JavaScript?

4

22

Error

NaN

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method selects an element with a specific class?

getElementByClassName

getElementsByClassName

queryElementClass

classSelector

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to add a click event to a button?

addEvent

onClick()

addEventListener()

clickEvent()

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?