• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 8 pages
Exam (elaborations)

Javascript Quiz With Complete Solutions

Document preview thumbnail
Preview 2 out of 8 pages

JAVASCRIPT QUIZ WITH COMPLETE SOLUTIONS

Content preview

JAVASCRIPT QUIZ WITH COMPLETE
SOLUTIONS



1.Inside which HTML element do we put the JavaScript?
a) <javascript>
b) <js>
c) <script>
d) <scripting> - Correct Answers -c) <script>

2. What is the correct JavaScript syntax to write "Hello World"?
a) response.write("Hello World")
b) "Hello World"
c) document.write("Hello World")
d) ("Hello World") - Correct Answers -c) document.write("Hello World")

3. Where is the correct place to insert a JavaScript?
a) Both the <head> section and the <body> section are correct
b) The <body> section
c) The <head> section - Correct Answers -a) Both the <head> section and the <body>
section are correct

4. What is the correct syntax for referring to an external script called "xxx.js"?
a) <script src="xxx.js">
b) <script name="xxx.js">
c) <script href="xxx.js">
d) <script value="xxx.js"> - Correct Answers -a) <script src="xxx.js">

5. An external JavaScript must contain the <script> tag
a) False
b) True - Correct Answers -a) False

6. How do you write "Hello World" in an alert box?
a) alert("Hello World")
b) msgBox("Hello World")
c) alertBox="Hello World"
d) alertBox("Hello World") - Correct Answers -a) alert("Hello World")

7. How do you create a function?
a) function:myFunction()

, b) function=myFunction()
c) function myFunction()
d) myFunction():function - Correct Answers -c) function myFunction()
38. In JavaScript, what would be the proper form of address in the object hierarchy for
the second element in a form called "info"?
a) document.info.elements[1]
b) document.info.elements[2]
c) document.forms.info.elements[2]
d) info.elements[2] - Correct Answers -a) document.info.elements[1]

39. A named element in a JavaScript program that is used to store and retrieve data is a
_____.
a) Method
b) assignment operator
c) Variable
d) string - Correct Answers -c) Variable

40. Which of the following is not true
a) CSS is tightly integrated with the HTML structure.
b) CSS is part of dynamic HTML.
c) CSS stand for cascading style sheet.
d) CSS is for design control of the Web page appearance. - Correct Answers -a) CSS is
tightly integrated with the HTML structure.

8. How do you call a function named "myFunction"?
a) call myFunction()
b) myFunction()
c) call function myFunction
d) Call.myFunction() - Correct Answers -b) myFunction()

9. How do you write a conditional statement for executing some statements only if "i" is
equal to 5?
a) if i==5 then
b) if (i==5)
c) if i=5 then
d) if i=5 - Correct Answers -b) if (i==5)

10. How do you write a conditional statement for executing some statements only if "i" is
NOT equal to 5?
a) if (i != 5)
b) if =! 5 then
c) if (i <> 5)
d) if <>5 - Correct Answers -a) if (i != 5)

11. How many looping statements are there in JavaScript?
a) 2. The "for" loop, and the "while" loop

Document information

Uploaded on
October 29, 2025
Number of pages
8
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
millyphilip
3.7
(562)
Sold
3013
Followers
1964
Items
47782
Last sold
1 day ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions