JavaScript Quiz 1

By | February 17, 2018

This quiz contains basic JavaScript questions to start with. Giving the quiz helps in brushing up JavaScript concepts and its fun as well to analyze yourself before appearing for any real time test.

JavaScript Quiz 1

Question 1
Which of the following can be used to access elements from the DOM:
A
getElementById
B
getElementsByTagName
C
getElementsByClassName
D
getElementsByName
E
All of the above
Question 2
Which of the following is NOT a type of Dialog box:
A
Alert Box
B
React Box
C
Prompt Box
D
Confirm Box
Question 3
Which of the following is NOT true about JavaScript:
A
It has Java like syntax
B
Semicolon is optional
C
It is case insensitive
D
Runs on client machine
Question 4
Where can we write JavaScript in our HTML document:
A
In the Head
B
In The Body
C
In a separate file
D
Any of the 3 places
Question 5
Which event is triggered when the user enters the page:
A
onFocus
B
onSubmit
C
onLoad
D
onChange
Question 6
Which of the following is a method for timing events:
A
setTimeout()
B
setInterval()
C
Both
D
None
Question 7
JavaScript is a ______ -side Scripting Language:
A
Server
B
Browser
C
ISP
D
None of these
Question 8
We can declare an Integer variable using which of the following syntax:
A
Integer num;
B
int num;
C
var num;
D
integer num;
Question 8 Explanation: 
We declare a JavaScript variable with the var keyword.
There are 8 questions to complete.
List
Return
Shaded items are complete.
12345
678
Return