0% found this document useful (0 votes)
79 views5 pages

Web Quiz-6

The document discusses JavaScript concepts like data types, variables, operators, and events. It contains 20 multiple choice questions related to JavaScript. Some key points covered are: - JavaScript has 3 primitive data types: numbers, strings, and booleans. - Variables can have either global or local scope. - Common operators include arithmetic, comparison, logical, and assignment. - Events allow JavaScript to trigger functions in response to user actions or browser events. Common events are onchange, onsubmit, onreset, etc. - Dialog boxes in JavaScript include alert, confirm, and prompt boxes.

Uploaded by

442050215
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views5 pages

Web Quiz-6

The document discusses JavaScript concepts like data types, variables, operators, and events. It contains 20 multiple choice questions related to JavaScript. Some key points covered are: - JavaScript has 3 primitive data types: numbers, strings, and booleans. - Variables can have either global or local scope. - Common operators include arithmetic, comparison, logical, and assignment. - Events allow JavaScript to trigger functions in response to user actions or browser events. Common events are onchange, onsubmit, onreset, etc. - Dialog boxes in JavaScript include alert, confirm, and prompt boxes.

Uploaded by

442050215
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

QUIZ-6

JAVASCRIPT

1. Scripting language is(A)


A. High Level Programming language
B. Assembly Level programming language
C. Machine level programming language
D. None of the above

2. Which of the following is not true about document object in JavaScript?(C)


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

3. Which of the following attribute of form tag is not set by using document object in
JavaScript?(D)
A. Target
B. Enctype
C. Action
D. All of the above

4. Which of the following is syntactically correct way to access the any element of form
object?(A)
A. document.forms[0].elements[0]
B. document.forms.element
C. document[0].forms.element
D. document.forms[0].element

5. Which of the following is not true about JavaScript?(B)


A. It is a scripting language.
B. It execute with preliminary compilation.
C. It is a lightweight programming language.
D. It can be embedded directly into HTML pages.

6. Which of the following JavaScript cannot do?(D)


A. JavaScript can react to events.
B. JavaScript can manipulate HTML elements.
C. JavaScript can be use to validate data.
D. All of the Above

7. What is the output of the following javascript code? <script type="text/javascript">


x=4+"4"; document.write(x); </script>(A)
A. 44
B. 8
C. 4
D. Error output

8. What is the output of the following javascript code? <script type="text/javascript"> function
x(z,t) { alert(x.length); } </script>(B)
A. Error
B. 2
C. 1
D. 3

9. What is the output of following JavaScript code? <script type="text/javascript"> var cst =
"Teds India"; var result = cst.split(" "); document.write(result); </script>(C)
A. Teds
B. T,e,d,s,I,n,d,i,a
C. Teds,India
D. Teds India

10. Which of the following is true?(A)


A. If onKeyDown returns false, the key-press event
B. If onKeyPress returns false, the key-down event
C. If onKeyDown returns false, the key-up event is
D. If onKeyPress returns false, the key-up event is

11. Choose the client-side JavaScript object:(D)


A. Database
B. Cursor
C. Client
D. FileUpLoad

12. What is meant by "this" keyword in JavaScript?(A)


A. It refers current object
B. It referes previous object
C. It is variable which contains value
D. None of the above

13. What is the output of following JavaScript code? <script type="text/javascript"> var cst =
new Array(); cst[0] = "Web Development"; cst[1] = "Application Development" cst[2] =
"Testing" cst[3] = "TedsIndia Software Technologies"; document.write(cst[0,1,2,3]);
</script>(B)
A. Error
B. TedsIndia Software Technologies
C. Web Development
D. Web Developmnet,Application Development,Testing,
14. In JavaScript, which of the following method is used to evaluate the regular expression?(A)
A. eval(2*(3+5))
B. evaluate(2*(3+5))
C. evalu(2*(3+5))
D. None of the above

15. _________ keyword is used to declare variables in javascript.(A)


A. Var
B. Dim
C. String
D. None of the above

16. How do you create a new object in JavaScript?(A)


A. var obj = {};
B. var obj = Object();
C. var obj=new {};
D. None of the above

17. What does parseFloat(9+10) evaluates to in JavaScript?(D)


A. 19
B. 910
C. 109
D. None

18. Choose the external object among the following(D)


A. Date
B. Option
C. Layer
D. Checkbox

19. What is the output of following JavaScript code? <script type="text/javascript"> var
cst=((45%2)==0)?"hello":"bye"; document.write(cst); </script>(B)
A. hello
B. bye
C. Error in string handling
D. None of the above

20. What does ParseInt("15",10) evaluates to?(A)


A. 15
B. 10
C. 151
D. 150
The typeof is a unary operator that is placed before its single operand, which can be of any type.

A global variable has global scope which means it is defined everywhere in your JavaScript
code.

A local variable will be visible only within a function where it is defined. Function parameters
are always local to that function.

A function is a group of reusable code which can be called anywhere in your programme.

1. what are the advantages of javascript?

Sol: Less server interaction

Immediate feedback to the visitors

Increased interactivity

Richer interfaces

2. What are the important attributes of <script> tag?

Sol: The script tag takes two important attributes:

 language: This attribute specifies what scripting language you are using. Typically, its
value will be javascript.

 type: This attribute is what is now recommended to indicate the scripting language in use
and its value should be set to "text/javascript".

3. Where is the script code placed in the html program?

Sol: There is a flexibility given to include JavaScript code anywhere in an HTML document.

Script in <head>...</head> section.

Script in <body>...</body> section.

Script in <body>...</body> and <head>...</head> sections.

Script in and external file and then include in <head>...</head> section.

4. What are the various data types in javascript?

Sol: JavaScript allows you to work with three primitive data types:
 Numbers eg. 123, 120.50 etc.
 Strings of text e.g. "This text string" etc.
 Boolean e.g. true or false.

5. what are the variable scope in javasript?

 Sol: Global Variables: A global variable has global scope which means it is defined
everywhere in your JavaScript code.
 Local Variables: A local variable will be visible only within a function where it is
defined. Function parameters are always local to that function.

6.write the different operators in javascript?

Sol: Arithmetic Operators


Comparision Operators
Logical (or Relational) Operators
Assignment Operators
Conditional (or ternary) Operators

7. Name few events.


Sol:
Onchange
Onsubmit
Onreset
Onselect
Onblur
Onfocus

8. Name the dialog boxes in javaScript.

Sol: Alert box

Confirm box

Prompt box

You might also like