Web Quiz-6
Web Quiz-6
JAVASCRIPT
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
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
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
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
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.
Increased interactivity
Richer interfaces
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".
Sol: There is a flexibility given to include JavaScript code anywhere in an HTML document.
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.
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.
Confirm box
Prompt box