Oh No .... Not Another JavaScript Test!

1. Inside which HTML element do we put the JavaScript? - 1 point(s)
  < scripting >
  < javascript >
  < js >
  < script >

2. What is the correct JavaScript syntax to write "Hello World"? - 1 point(s)
  response.write("Hello World")
  ("Hello World")
  "Hello World"
  document.write("Hello World")

3. Where is the correct place to insert a JavaScript? - 1 point(s)
  The section
  The section
  Both the section and the section are correct

4. How do you write "Hello World" in an alert box? - 1 point(s)
  alertBox("Hello World")
  alert("Hello World")
  alertBox="Hello World"
  msgBox("Hello World")

5. How do you create a function? - 1 point(s)
  function:myFunction()
  function myFunction()
  function=myFunction()

6. How do you call a function named "myFunction"? - 1 point(s)
  myFunction()
  call function myFunction
  call myFunction()

7. How do you write a conditional statement for executing some statements only if "i" is equal to 5? - 1 point(s)
  if i=5 then
  if i==5 then
  if (i==5)
  if i=5

8. How do you write a conditional statement for executing some statements only if "i" is NOT equal to 5? - 1 point(s)
  if <>5
  if (i <> 5)
  if =! 5 then
  if (i != 5)

9. How does a "for" loop start? - 1 point(s)
  for (i = 0; i <= 5; i++)
  for (i <= 5; i++)
  for (i = 0; i <= 5)
  for i = 1 to 5

10. How can you add a comment in a JavaScript? - 1 point(s)
  //This is a comment
  'This is a comment
  < !--This is a comment-- >
  #This is a comment

11. What is the correct JavaScript syntax to insert a comment that has more than one line? - 1 point(s)
  //This comment has more than one line//
  < !--This comment has more than one line-- >
  /*This comment has more than one line*/

12. What is the correct way to write a JavaScript array? - 1 point(s)
  var txt = new Array("tim","kim","jim")
  var txt = new Array="tim","kim","jim"
  var txt = new Array:1=("tim")2=("kim")3=("jim")
  var txt = new Array(1:"tim",2:"kim",3:"jim")

13. What is the correct JavaScript syntax for opening a new window called "window2" ? - 1 point(s)
  window.open("http://www.w3schools.com","window2")
  new("http://www.w3schools.com","window2")
  new.window("http://www.w3schools.com","window2")
  open.new("http://www.w3schools.com","window2")

directNIC Search
Hosted by directNIC.com

Hosted by www.Geocities.ws

1