100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

W3SCHOOLS JAVASCRIPT QUIZ QUESTIONS AND ANSWERS

Rating
-
Sold
-
Pages
2
Grade
A+
Uploaded on
29-10-2025
Written in
2025/2026

W3SCHOOLS JAVASCRIPT QUIZ QUESTIONS AND ANSWERS

Institution
JAVASCRIPT
Course
JAVASCRIPT








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
JAVASCRIPT
Course
JAVASCRIPT

Document information

Uploaded on
October 29, 2025
Number of pages
2
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & 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++)

Get to know the seller

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 West Virginia University
View profile
Follow You need to be logged in order to follow users or courses
Sold
2814
Member since
3 year
Number of followers
1959
Documents
41006
Last sold
2 days ago
white orchid store

EXCELLENCY IN ACCADEMIC MATERIALS ie exams, study guides, testbanks ,case, case study etc

3.7

534 reviews

5
234
4
83
3
103
2
31
1
83

Recently viewed by you

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

Frequently asked questions