JavaScript Fundamentals Quiz

Test your knowledge of JavaScript programming including syntax, functions, objects, events, cookies, and browser compatibility

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Consider an HTML form with a checkbox and a text field. When data is entered and the return key is pressed, the data seems to be lost before the user can click on the button that calls the processing function. How do you correct this?

  1. Add a TYPE=HIDDEN INPUT to the form
  2. Trap the return keypress and return (null
  3. Add 'return false' to onsubmit="..." in the FORM tag
  4. Instruct the user not to press the Return key.
Question 2 Multiple Choice (Single Answer)

Which JavaScript feature uses JAR files?

  1. Object signing
  2. Style sheets
  3. Netcaster channels
  4. Image rollovers
Question 3 Multiple Choice (Single Answer)

Which feature is supported in MSIE 3.x?

  1. split()
  2. document.clear()
  3. join()
  4. charAt()
Question 4 Multiple Choice (Single Answer)

What's the default setting for the expires attribute of the document.cookie property?

  1. The duration of the browser session.
  2. The duration the current document stays loaded.
  3. Twenty-four hours from the time the cookie is set.
  4. There is no default setting.
Question 5 Multiple Choice (Single Answer)

Which of the following is true?

  1. If onKeyDown returns false, the key-press event is cancelled.
  2. If onKeyPress returns false, the key-down event is cancelled.
  3. If onKeyDown returns false, the key-up event is cancelled.
  4. If onKeyPress returns false, the key-up event is cancelled.
Question 6 Multiple Choice (Single Answer)

Which best describes JavaScript?

  1. a low-level programming language.
  2. a scripting language precompiled in the browser.
  3. a compiled scripting language.
  4. an object-oriented scripting language.
Question 7 Multiple Choice (Single Answer)

Choose the server-side JavaScript object:

  1. FileUpLoad
  2. Function
  3. File
  4. Date
Question 8 Multiple Choice (Single Answer)

Choose the client-side JavaScript object:

  1. Database
  2. Cursor
  3. Client
  4. FileUpLoad
Question 9 Multiple Choice (Single Answer)

Seek the truth about setTimeOut():

  1. The statement(s) it executes run(s) only once.
  2. It pauses the script in which it is called.
  3. clearTimeOut() won't stop its execution.
  4. The delay is measured in hundredths of a second.
Question 10 Multiple Choice (Single Answer)

Which best describes void?

  1. A method
  2. A function
  3. A statement
  4. An operator
Question 11 Multiple Choice (Single Answer)

Inside which HTML element do we put the JavaScript?

  1. <javascript>
  2. <script>
  3. <js>
  4. <scripting>
Question 12 Multiple Choice (Single Answer)

What is the correct JavaScript syntax to write "Hello World"?

  1. ("Hello World")
  2. document.write("Hello World")
  3. response.write("Hello World")
  4. "Hello World"
Question 13 Multiple Choice (Single Answer)

What is the correct syntax for referring to an external script called "javascript.js"?

  1. <script type="text/javascript" name="javascript.js">
  2. <script type="text/javascript" src="javascript.js">
  3. <script type="text/javascript" href="javascript.js">
  4. <script type="text/javascript" link="javascript.js">
Question 14 Multiple Choice (Single Answer)

How do you round the number 7.25, to the nearest integer?

  1. rnd(7.25)
  2. round(7.25)
  3. Math.round(7.25)
  4. Math.rnd(7.25)
Question 15 Multiple Choice (Single Answer)

How can you find a client's browser name?

  1. browser.name
  2. navigator.appName
  3. client.navName
  4. clientbrowser.navName