If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Question:2
Which of the following functions can you use to test whether an object was created with a specific constructor or not?

a. instanceof
b. typeof
c. classof
d. classname

Question:3
Which of the following ways can you use to prevent default action when a user clicks on a link on any browser?

a. Use preventDefault method of event object on click event handler.
b. Set returnValue of event object to false on click event handler.
c. Return false value on click event handler.
d. There is no way to prevent default action.

Question:4
Consider the following code snippet:

if (document.addEventListener){
alert("addEventListener");
} else if (document.attachEvent){
alert("attachEvent");
}
What does the alert box display on Internet Explorer?

a. addEventLister
b. attachEvent
c. There is no alert box
d. This code snippet is invalid

Question:5
What is the result of c in the following code snippet?

var a = '1';
b = 2 * a;
c = typeof(b);

a. char
b. string
c. number
d. None of the above

Question:6
screen.pixelDepth is not available in Internet Explorer 7.

a. True
b. False

Question:7
Which of the following functions can be used to stop an event from propagating if you're using a W3C-compliant browser?

a. stopPropagation
b. endPropagation
c. finishPropagation
d. There are no such methods

Question:8
Which of the following is a good reason to avoid user agent sniffing?

a. User can change the user agent.
b. user agent is the same for all browsers.
c. Some browsers do not have user agent.
d. There is no reason to avoid user agent sniffing.

Question:9
What is the value of c in the following code snippet?

var a = {f: 1};
var b = a;
b.f = 100;
var c = a.f;

a. undefined
b. null
c. 1
d. 100

Question:10
What does the following statement do?

document.title = "JavaScript";

a. It changes the title of the current window to "JavaScript" but does not change the text of the title tag.
b. It changes the text of «title» tag to "JavaScript".
c. It changes the global title variable value to "JavaScript".
d. This statement is invalid.

Question:11
one way to add functions to an object is by ___.

a. adding functions to that object prototype.
b. declaring a new function with that object name as prefix.
c. There is no way to add functions to an existing object.

Question:12
Which of the following properties contains user agent string of web browser?

a. At the time this code snippet is executed, the element with id1 does not exist.
b. The function getElementById is not document's function.
c. It cannot alert a DOM element.
d. There is nothing wrong with the given code snippet.