Jan 30, 2013

JavaScript multiple choice questions and answers


JavaScript MCQ or multiple choice questions and answers for interview and test

1. Which of the following is not true about document object in JavaScript? 

A. It may contain array of forms object.
B. We can reference the forms object from document using position.
C. We can reference the forms object from document object using name.
D. A document object always keeps single form object.
E. Position of first forms object begins from zero.

Answer: D

2. Which of the following attribute of form tag is not set by using document object in JavaScript?

A. Target
B. Enctype
C. Action
D. Method
E. All of the above can be set.

Answer: E

3. Which of the following is syntactically correct way to access the any element of form object?  

A. document.forms.element
B. document[0].forms.element
C. document.forms[0].element
D. document.forms[0].elements[0]
E. document.forms.elements[0]

Answer:  D

4. Which of the following is not true about JavaScript?

A. It is a scripting language.
B. It was designed to add interactivity to HTML pages.
C. It is a lightweight programming language.
D. It execute with preliminary compilation.
E. It can be embedded directly into HTML pages.

Answer: D

5. Which of the following JavaScript cannot do?

A. JavaScript can react to events.
B. JavaScript can manipulate HTML elements.
C. JavaScript can be use to validate data.
D. JavaScript can create cookies.
E. All of the above are correct.

Answer: E

1. D
2. E
3. D
4. D
5. E

No comments:

Post a Comment