JAVASCRIPT Exam Questions and Answers Latest Graded A+, Exams of Javascript programming

JAVASCRIPT Exam Questions and Answers Latest Graded A+

Typology: Exams

2025/2026

Available from 05/18/2026

DrBenard
DrBenard 🇺🇸

3.5K documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
JAVASCRIPT Exam Questions and Answers Latest Graded A+
1. Inside which HTML element do we put the JavaScript? - ✔✔<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> - ✔✔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 - ✔✔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"> - ✔✔<script src="xxx.js">
5. The external JavaScript file must contain the <script> tag. - ✔✔False
6. How do you write "Hello World" in an alert box? - ✔✔alert("Hello World");
7. How do you create a function in JavaScript? - ✔✔function myFunction()
8. How do you call a function named "myFunction"? - ✔✔myFunction()
9. How to write an IF statement in JavaScript? - ✔✔if (i == 5)
pf3

Partial preview of the text

Download JAVASCRIPT Exam Questions and Answers Latest Graded A+ and more Exams Javascript programming in PDF only on Docsity!

JAVASCRIPT Exam Questions and Answers Latest Graded A+

  1. Inside which HTML element do we put the JavaScript? - ✔✔
  2. How to write an IF statement for executing some code if "i" is NOT equal to 5? - ✔✔if (i != 5)
  3. How does a WHILE loop start? - ✔✔while (i <= 10)
  4. How does a FOR loop start? - ✔✔for (i = 0; i <= 5; i++)
  5. How can you add a comment in a JavaScript? - ✔✔//This is a comment
  6. How to insert a comment that has more than one line? - ✔✔/This comment has more than one line/
  7. What is the correct way to write a JavaScript array? - ✔✔var colors = ["red", "green", "blue"]
  8. How do you round the number 7.25, to the nearest integer? - ✔✔Math.round(7.25)
  9. How do you find the number with the highest value of x and y? - ✔✔Math.max(x, y)
  10. What is the correct JavaScript syntax for opening a new window called "w2"? - ✔✔w2 = window.open("http://www.w3schools.com");
  11. JavaScript is the same as Java. - ✔✔False
  12. How can you detect the client's browser name? - ✔✔navigator.appName
  13. Which event occurs when the user clicks on an HTML element? - ✔✔onclick
  14. How do you declare a JavaScript variable? - ✔✔var carName;