Want to see correct answers?
Login or join for free!
  printable Worksheets
Looking for printable worksheets?
Check out our pre-made printable worksheets!
Share/Like This Page
Filter By Grade

JavaScript Questions - All Grades

You can create printable tests and worksheets from these JavaScript questions! Select one or more questions using the checkboxes above each question. Then click the add selected questions to a test button before moving to another page.

Continuing Education JavaScript
Continuing Education JavaScript
Inside which HTML element do we put the JavaScript?
  1. <javascript>
  2. <js>
  3. <script>
  4. <scripting>
Continuing Education JavaScript
How do you write "Hello World" in an alert box?
  1. alertBox("Hello World")
  2. msgBox("Hello World")
  3. alertBox="Hello World"
  4. alert("Hello World")
Continuing Education JavaScript
How do you call a function named "myFunction"?
  1. call function myFunction
  2. call myFunction()
  3. myFunction()
Continuing Education JavaScript
Where is the correct place to insert a JavaScript?
  1. The <head> section
  2. The <body> section
  3. Both the <head> section and the <body> section are correct
Continuing Education JavaScript
What is the correct JavaScript syntax to write "Hello World"?
  1. response.write("Hello World")
  2. document.write("Hello World")
  3. "Hello World"
  4. $("Hello World")
Continuing Education JavaScript
Continuing Education JavaScript
Continuing Education JavaScript
How do you create a function?
  1. function:myFunction()
  2. function=myFunction()
  3. function myFunction()
Continuing Education JavaScript
What is the correct JavaScript syntax to insert a comment that has more than one line?
  1. //This comment has more than one line//
  2. /*This comment has more than one line*/
Continuing Education JavaScript
How does a "while" loop start?
  1. while i=1 to 10
  2. while (i<=10;i++)
  3. while (i<=10)
Continuing Education JavaScript
What is the correct syntax for referring to an external script called "xxx.js"?
  1. <script type="text/javascript" src="xxx.js">
  2. <script type="text/javascript" name="xxx.js">
  3. <script type="text/javascript" href="xxx.js">
Continuing Education JavaScript
How does a "for" loop start?
  1. for i = 1 to 5
  2. for (i <= 5; i++)
  3. for (i = 0; i <= 5; i++)
  4. for (i = 0; i <= 5)