JavaScript MCQ with Answers

  1. In which element we put javascript?
  2. The correct place to insert a JavaScript is ?
  3. Which of the following is the correct syntax for referring to an external script called "xxx.js"?
  4. How we write "Hello World" in an alert box?
  5. Which of the following is an IF statement in JavaScript?
  6. Which of the following is the correct statement of WHILE loop start?
  7. Which of the following is the correct statement for comment in a JavaScript?
  8. Is JavaScript is the same as Java?
  9. ____________operator is used to assign a value to a variable?
  10. JavaScript is case-sensitive. True or False?
  11. Which of the following event occurs when the user clicks on an HTML element?
  12. Javascript was designed for which of the following purposes
  13. Which of the following attribute is used to specify the character encoding used in an external script file?
  14. Executable single line of Script is called as _________________.
JavaScript MCQ

Take JavaScript MCQ Quiz & Online Test to Test Your Knowledge 

We have listed below the best JavaScript MCQ Questions, that check your basic knowledge of JavaScript. This JavaScript MCQ Test contains 25+ multiple-choice questions. You have to select the right answer to every question to check your final preparation. apart from this, You can also download below the JavaScript MCQ Pdf completely free.

Also, Read the Best JavaScript Interview Questions.

  • <javascript>
  • <scripting>
  • <script>
  • None of These
View Answer
  • The <head> section
  • The < body> section
  • Both 1 & 2
  • none of these
View Answer
  • <script src="xxx.js">
  • <script src="xxx.js">
  • <script name="xxx.js">
  • None of These
View Answer
  • alertBox("Hello World");
  • msgBox("Hello World");
  • msg("Hello World");
  • alert("Hello World");
View Answer
  • if i = 5
  • if i = 5 then
  • if (i == 5)
  • All of these
Download Free : JavaScript MCQ PDF
View Answer
  • while (i <= 10)
  • while (i <= 10; i++)
  • while i = 1 to 10
  • None of These
View Answer
  • //This is a comment
  • /*This is a comment*/
  • $This is a comment$
  • None of These
View Answer
  • Yes
  • No
View Answer
  • *
  • x
  • =
  • +
View Answer
  • onmouseclick
  • onmouseover
  • onclick
  • None
View Answer
  • To Style HTML Pages
  • To Perform Server Side Scripting Opertion
  • To add interactivity to HTML Pages
  • To Execute Query Related to DB on Server
View Answer
  • Breakpoint in JS
  • Statement in JavaScript
  • Line in JS
  • None of the above
View Answer
  • Executable Statement
  • Declaration Statement
  • Conditional Statement
  • Assignment Statement
View Answer
  • Assignment operator
  • Bitwise Operator
  • Conditional operator
  • Logical Operator
View Answer
  • alert("OnlineInterviewQuestions");
  • confirm("OnlineInterviewQuestions");
  • msgbox("OnlineInterviewQuestions");
  • None of the above
View Answer
  • It can not Handling dates and time.
  • JavaScript is a object-based scripting language.
  • JavaScript is not interpreter based scripting language.
  • None of the above
View Answer
  • Varying randomly
  • Storing numbers, dates, or other values
  • Causing high-school algebra flashbacks
  • None of the above
View Answer