Q: JavaScript is mainly used for:
A) Database management
B) Client-side scripting
C) Operating systems
D) Networking
Client-side scripting
Q: Which tag is used to write JavaScript in an HTML page?
A) <js>
B) <javascript>
C)
</javascript></js>
D) <code></code>
<script> </script>
Q: Which function is used to display a message box in JavaScript?
A) print()
B) display()
C) alert()
D) message()
alert()
Q: Which function is used to take input from the user in JavaScript?
A) alert()
B) prompt()
C) input()
D) read()
prompt()
Q: Which function is used to convert a string into an integer?
A) convertInt()
B) parseInt()
C) stringInt()
D) toNumber()
parseInt()
________ is a scripting language used to make web pages interactive.
JavaScript
The ________ tag is used to include JavaScript in HTML.
<script> </script>
The ________ function displays a message in a pop-up box.
alert()
The ________ function is used to take input from the user.
prompt()
In JavaScript, ________ are used to store values.
Variables
JavaScript is a programming language used for web pages.
True
JavaScript code is written inside the
tag.
true
The alert() function takes input from the user.
False
JavaScript can perform calculations.
True
Variables cannot be used in JavaScript.
False
Q: Which operator is used for addition in JavaScript?
A) *
B) -
C) +
D) /
+
Q: Which operator is used to check equality in JavaScript?
A) =
B) ==
C) ===
D) !=
==
Q: Which loop repeats a block of code multiple times?
A) select
B) if
C) for
D) choose
for
Q: Which keyword is used to declare a variable in JavaScript?
A) integer
B) variable
C) var
D) number
var
Q: Which statement is used for decision making in JavaScript?
A) repeat
B) if
C) loop
D) goto
if
The ________ operator is used for multiplication in JavaScript.
*
The ________ statement is used to execute code when a condition is true.
if
________ are used to perform operations on values.
operators
The ________ loop is commonly used to repeat a set of statements.
for