[go: up one dir, main page]

0% found this document useful (0 votes)
236 views2 pages

Quiz 2

The document is a quiz with 10 multiple choice questions about JavaScript and HTML. It tests knowledge of topics like where JavaScript code is placed, strong vs weak typing, arrays, objects, the DOM, DHTML, and JavaScript functions and events.

Uploaded by

Hari Haran
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
236 views2 pages

Quiz 2

The document is a quiz with 10 multiple choice questions about JavaScript and HTML. It tests knowledge of topics like where JavaScript code is placed, strong vs weak typing, arrays, objects, the DOM, DHTML, and JavaScript functions and events.

Uploaded by

Hari Haran
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Name ___________________ Quiz #2

1. Inside which HTML element do we put the JavaScript? (Circle one) a. <script> b. <javascript> c. <scripting> d. <js> 2. When a programming language is strongly typed: (Circle one) a. The compiler checks if values assigned to variables are the correct type b. The run-time system checks if values assigned to variables are the correct type c. The browser checks if values assigned to variables are the correct type d. No type checking need be done e. None of these 3. What is the correct way to write a JavaScript array? (Circle one)

a. b. c. d.

var txt = new Array("tim","kim","jim") var txt = new Array(1:"tim",2:"kim",3:"jim") var txt = new Array="tim","kim","jim" var txt = new Array:1=("tim")2=("kim")3=("jim")

4. The following are always objects in Javascript: (Circle all that apply) a. Numbers b. Strings c. Arrays d. Functions e. Parameters 5. The Document Object Model (DOM): : (Circle all that apply) a. Is an internal map of all the objects that exist on a web page b. Defines the interface between HTML and application programs c. Binds HTML tags as Javascript objects and HTML tag attributes as Javascript properties d. Defines a hierarchical structure of the objects on a web page e. Attempts to be a successor to DHTML 6. DHTML is a. HTML 4 with tags for creating dynamic pages b. HTML 4 +CSS + Javascript c. Simple HTML 4 used in a dynamic way d. HTML 4 + Applets e. None of these

7. What is the correct JavaScript syntax for opening a new window called "window2"? a. window.open("http://www.wpi.edu","window2")

b. new("http://www.wpi.edu","window2") c. open.new("http://www.wpi.edu","window2") d. new.window("http://www.wpi.edu","window2")


8.10. Consider the following:
<html> <head> <title> quiz this </title> <script> function mystery4 (object) { document.write ("I am " + object);} </script> </head> <body> <FORM NAME="Mystery">Form name: <INPUT NAME="text1" TYPE="text" VALUE="Mystery 1"><P> <INPUT NAME="button1" TYPE="button" VALUE="Mystery 2" onClick="this.form.text1.value=this.form.name"> <INPUT NAME="button2" TYPE="button" VALUE="Mystery 3" onClick="this.form.text1.value= mystery4(this.value)"> </FORM> </body>

</html> 8. Show the screen when the page is first loaded

9. Show the screen when the leftmost button is pressed

10. Show the screen when the rightmost button is pressed

You might also like