and Correct Answers | New Update
1.Inside which HTML element do we put the JavaScript?
a) <javascript>
b) <js>
c) <script>
d) <scripting> - 🧠 ANSWER ✔✔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") - 🧠 ANSWER ✔✔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
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE. PRIVACY
1
STATEMENT. ALL RIGHTS RESERVED
,b) The <body> section
c) The <head> section - 🧠 ANSWER ✔✔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"> - 🧠 ANSWER ✔✔a) <script src="xxx.js">
5. An external JavaScript must contain the <script> tag
a) False
b) True - 🧠 ANSWER ✔✔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"
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE. PRIVACY
2
STATEMENT. ALL RIGHTS RESERVED
, d) alertBox("Hello World") - 🧠 ANSWER ✔✔a) alert("Hello World")
7. How do you create a function?
a) function:myFunction()
b) function=myFunction()
c) function myFunction()
d) myFunction():function - 🧠 ANSWER ✔✔c) function myFunction()
8. How do you call a function named "myFunction"?
a) call myFunction()
b) myFunction()
c) call function myFunction
d) Call.myFunction() - 🧠 ANSWER ✔✔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
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE. PRIVACY
3
STATEMENT. ALL RIGHTS RESERVED