Share/Like This Page

JavaScript Questions - All Grades

Create printable tests and worksheets from JavaScript questions. Select questions to add to a test using the checkbox above each question. Remember to click the add selected questions to a test button before moving to another page.

The JavaScript questions below are in the following grade levels: Continuing Education
Continuing Education :: JavaScript by yasserhy
Continuing Education :: JavaScript by yasserhy
Inside which HTML element do we put the JavaScript?
  1. <javascript>
  2. <js>
  3. <script>
  4. <scripting>
Continuing Education :: JavaScript by yasserhy
How do you call a function named "myFunction"?
  1. call function myFunction
  2. call myFunction()
  3. myFunction()
Continuing Education :: JavaScript by yasserhy
Continuing Education :: JavaScript by yasserhy
Continuing Education :: JavaScript by yasserhy
How does a "while" loop start?
  1. while i=1 to 10
  2. while (i<=10;i++)
  3. while (i<=10)
Continuing Education :: JavaScript by yasserhy
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 by yasserhy
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)
Continuing Education :: JavaScript by yasserhy
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 by yasserhy
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 by yasserhy
How do you create a function?
  1. function:myFunction()
  2. function=myFunction()
  3. function myFunction()
Continuing Education :: JavaScript by yasserhy
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 by yasserhy
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*/
You need to have at least 5 reputation to vote a question down. Learn How To Earn Badges.