• 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 1 out of 2 pages
Exam (elaborations)

W3Schools Javascript Quiz Questions And Answers

Document preview thumbnail
Preview 1 out of 2 pages

W3SCHOOLS JAVASCRIPT QUIZ QUESTIONS AND ANSWERS

Content preview

W3SCHOOLS JAVASCRIPT QUIZ



1. Inside which HTML element do we put the JavaScript? - Correct Answers -<script>

2. What is the correct JavaScript syntax to change the content of the HTML element
below?

<p id="demo">This is a demonstration.</p> - Correct Answers -
document.getElementById("demo").innerHTML = "Hello World!";

3. Where is the correct place to insert a JavaScript?

The <body> section
Both the <head> section and the <body> section are correct
The <head> section - Correct Answers -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"?

<script name="xxx.js">
<script src="xxx.js">
<script href="xxx.js"> - Correct Answers -<script src="xxx.js">
9. How to write an IF statement in JavaScript? - Correct Answers -if (i == 5)

10. How to write an IF statement for executing some code if "i" is NOT equal to 5? -
Correct Answers -if (i != 5)

11. How does a WHILE loop start? - Correct Answers -while (i <= 10)

5. The external JavaScript file must contain the <script> tag. - Correct Answers -False

6. How do you write "Hello World" in an alert box? - Correct Answers -alert("Hello
World");

7. How do you create a function in JavaScript? - Correct Answers -function
myFunction()

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

12. How does a FOR loop start? - Correct Answers -for (i = 0; i <= 5; i++)

Document information

Uploaded on
October 29, 2025
Number of pages
2
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$9.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
(563)
Sold
3024
Followers
1965
Items
48208
Last sold
14 hours 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