Thursday, August 29, 2013

oDesk Adobe illustrator CS3 Test Answers 2013-2014

Question-1: Changing units on the Info Palette automatically changes the units on Rulers.
Ans: TRUE
Question-2: Which of the following Filters cannot be applied to a Smart Object?

Ans: Pattern Maker
Question-3: With which of the given options does the Signal Strength Meter appear?
Ans: It appears when you choose ‘merge to hdr command’
Question-4: Channels can not be added to which of the following image modes?
Ans: Bitmap
Question-5: Which among the following Modes does not support layers?
Ans: All of the above
Question-6: Which of the following is not true about Filters?
Ans: None of the above
Question-7: Which of the following is not true about the Curves dialog box?
The Curves dialog box lets you adjust up to 14 different points throughout an image’s
Ans: tonal range
Question-8: Which of the following Slices is created with the Slice Tool?
Ans: User slices
Question-9: Which of the following features is supported by the EPS file format?
Ans: It supports the Grayscale and Bitmap color modes
Question-10: Which among the following blending modes is available only for the Apply Image and Calculations commands?
Ans: Both a and b
Question-11: What is the use of the Make Work Path command in the Paths palette ?
Ans: It can alter the shape of a selection
Question-12: Which type of information is not displayed by the Info Palette?
Ans: It does not display the opacity of the current layer
Question-13: Which among the following is not a right option for selecting a web-safe color from the Color Palette?
Ans: Choose Current Color from the Color Palette Menu
Question-14: Which keyboard shortcut (windows) will you choose to close a Path?
Ans: None of the above
Question-15: Anti-aliasing option is available for which of the given Tools?
Ans: All of the above
Question-16: Which of the following options displays the Spot Channels in the Channels palette?
Ans: B
Question-17: What happens when Use Legacy is selected as shown in the given picture?
Ans: It is used to apply proportionate (nonlinear) adjustments to image pixels
Question-18: Which option will you select to open the Levels dialog box?
Ans: Choose Image > Adjustments > Levels
Question-19: Which type of images are resolution-dependent?
Ans: Vector images
Question-20: Which Liquify Tool is used to reconstruct a part of a distorted image?
Ans: A
Question-21: In which Format will you save your file to preserve the Alpha channels?
Ans: All of the above
Question-22: Which of the following is not a kind of text type?
Line type
Question-23: Ans: Which option will you select to convert Types to Shapes?
Both b and c
Question-24: The mask created by the Replace Color command is permanent.
Ans: FALSE
Question-25: Which of the following Layer properties can be animated?
Ans: All of the above
Question-26: Which View will you choose to display a Histogram with no controls or statistics?
Ans: All of the above
Question-27: Which of the given options displays left indent in the Paragraph palette?
Ans: B
Question-28: Which keyboard shortcut (windows) will you choose to group Layers?
Ans: Control + G
Question-29: The Rotate Canvas command does not work on which of the following
Ans: All of the above
Question-30: Which of the Saving commands is available for an image that is managed by a Version Cue Workspace?
Ans: Check In
Question-31: When will the Dynamic shortcuts appear in the Character Palette Menu as shown in the picture?
Ans: All of the above
Question-32: Hanging Punctuation controls the alignment of the punctuation marks for a specific paragraph.
Ans: TRUE
Question-33: Which option will you choose to select all layers of a similar type?
Ans: All of the above
Question-34: Which of the following is not a Color Adjustment command?
Ans: Adjustment command
Question-35: By default, Masks applied to Smart objects are linked to Smart object layers. .
Ans: FALSE
Question-36: A working space is an intermediate color space used to define and edit color in Adobe applications.
Ans: FALSE
Question-37: Which option will you select to remove the existing profile from the document in the given image?
Ans: C
Question-38: You cannot change the order of the Vector masks or working paths in the Paths palette.
Ans: FALSE
Question-39: The Color Replacement Tool does not work in which of the following Image modes?
Ans: All of the above
Question-40: In which of the following Modes can you draw while working with the Shape or Pen
tools?
Ans: All of the above
Question-41: The Out Of Gamut option works only on RGB and Lab images
Ans: TRUE
Question-42: Which among the following QuickTime Video formats is supported by Photoshop
extended?
Ans: MOV

Odesk DHTML test answer 2013

  1. You want to delete an element from an options array. How would you do it?

a.         Set it to false
b.        Set it to null
c.         Set it to undefined
d.        Set it to -1
e.         Set it to 0
f.         Set it to 1
  1. How can you change the image position from  relative to absolute if the image id is “ERImage”?

a.         document.getElementById(‘ERImage’).position=”absolute”
b.        document.getElementById(‘ERImage’).setAttribute(position, “absolute”)
c.         document.getElementById(‘ERImage’).style.position=”absolute;”
d.        document.getElementById(‘ERImage’).style.position=”absolute”
03.  If an image is placed styled with z-index=-1 and a text paragraph is overlapped with it. Which one will come on top?
a.         paragraph
b.        image
c.         any of the above
04. The following statements show two ways of calling a JavaScript function: i)onclick = “a()”
ii)onclick=”javascript:a()”
a() refers to a function written in JavaScript.

Which of the following statements is correct with regard to the above two statements?


a.         There is no difference between the two statements
b.        The first statement is incorrect and the second one is correct
05. While coding a loop, you come across a condition where you have to ignore the rest of the statements and continue with the beginning of the loop. Which of the following statements would you use?
a.         exit
b.        return
c.         continue
d.        while
e.         break
06. Consider the three variables: someText = ‘JavaScript1.2′;
pattern = /(\w+)(\d)\.(\d)/i;
outCome = pattern.exec(someText);

What does pattern.ignoreCase contain?

a.         true
b.        false
c.         undefined
d.        null
e.         0
07. *** A DHTML page contains a table in between some text. You want to shift the table 20 pixels on the right to separate it from text. Which of the following styles would be suitable for the purpose?

a.         position:relative;
left:20PX;
b.        position:relative;
left:-20PX;
c.         position:relative;
right:-20PX;
d.        position:relative;
right:20PX;
08. How would you create a popup window that closes after n seconds?
a.         You cannot program a window to close automatically after n seconds. The user will have to manually close it
b.        You would use the setTimeout function
c.         You would use the exit function of the window object
d.        You would use the terminate function
e.         None of the above
09. Which of the following styles will be helpful in keeping an image at a fixed position on the webpage, even if someone scrolls the page?
a.         background-style:fixed;
b.        background-style:static;
c.         background-attachment:fixed;
d.        background-attachment:static;
10. What is the default value for overflow property?
a.         scroll
b.        visible
c.         hidden
d.        auto
11. Which of the following properties of JavaScript is used to store the extra values for DHTML tricks?
a.         DHTML
b.        HTML
c.         innerHTML
d.        outerHTML
12. Consider the following validate function:
<script type=”text/javascript”>
function ValidateField()
{
if(document.forms[0].txtId.value ==”")
{return false;}
return true;
}
</script>
This function should be called as soon as the user leaves the field. What will you do?

a.         <input name=txtId type=”text” onreset=”return ValidateField()”>
b.        <input name=txtId type=”text” onfocus=”return ValidateField()”>
c.         <input name=txtId type=”text” onsubmit=”return ValidateField()”>
d.        <input name=txtId type=”text” onblur=”return ValidateField()”>
13. Given below is a window.open function: window.open(url,name,”attributes”)
How will you ensure that different URLs open in the same window?

a.         By keeping the second attribute name same
b.        By nullifying the name attribute
c.         By omitting the name attribute
d.        None of the above
14. Which of the following is not a JavaScript event?
a.         onabort
b.        onchange
c.         onupdate
d.        onkeydown
15. You are displaying image thumbnails on a page. Upon clicking a thumbnail, the image is being displayed in its actual size. You do not want the user to be able to click the thumbnails unless they are completely downloaded. Which event will you use to prevent the user from clicking on the thumbnails until they are completely downloaded?
a.         OnLoad
b.        OnKeyPress
c.         OnKeyUp
d.        onClick
16. The anchor tag is defined as follows: <a href=”http://expertrating.com”>expertrating</a>
Which of the following styles will make convert this to capital letters on mouseover?

a.         a:hover { text:ucase;}
b.        a:hover { text-style:uppercase;}
c.         a:hover { text-transform:uppercase;}
d.        a:hover { text-style:upper;}
17. You have a button definition as given below: <input type=”button” value=”Calculate”>
To load an image “Img2.jpg” as the background of the button on a mouseover event, you can use:


a.         event.srcElement.style.backgroundImage=”Img2.jpg”
b.        event.srcElement.style.Image=”Img2.jpg”
c.         event.srcElement.style.backgroundImage=”url(‘Img2.jpg’)”
d.        event.srcElement.style.Image=”url(‘Img2.jpg’)”
18. Which of the following statements is incorrect with regard to a style sheet?
a.         Style sheet defines how an HTML element will be displayed
b.        Internal and external style sheets cannot be used together
c.         Multiple style definitions will cascade into one
d.        Same style sheets can be used by many HTML pages
19. Which of the following statements with regard to CSS is correct?
a.         The positioning can be absolute, relative, or dynamic
b.        The float property for text/image can be left, right, or center
c.         The values for visibility can be true or false
d.        The display property sets how an element is displayed
20. How can you use a timer with a function called rearrange()?
a.         tmr=setTimeout(“rearrange()”,1)
b.        tmr=Timer(1,”rearrange()”)
c.         tmr=Timer(“rearrange()”,1)
d.        tmr=setTimeout(1,”rearrange()”
21. Which code will be useful for disabling the right click event in Internet Explorer?
a.         event.button == 2
b.        event.button == 4
c.         event.click == 2
d.        event.click == 4
22. Which of the following helps you create hyperlinks without an underline?
a.         a{text-decoration:none}
b.        a{text-decoration:noline}
c.         a{text-decoration:hide}
d.        a{text-decoration:invisible}
e.         a{ font-style: normal;}
f.         a{font-style: none;}
23. The width of the h4 is defined as follow: H4 {width:95%;}
How can you make the heading blur?

a.         <h4 filter(blur)>Heading</h42>
b.        <h4 style=”filter:blur()”>Heading </h4>
c.         <h4 style=”filter::blur()”>Heading </h4>
d.        <h4 style=”Blur()”>Heading </h4>
24. Which of the following will you use for changing the color of the textbox text with id=txtLocation to blue, on a mouseover event?

a.         txtLocation.color=”blue”
b.        document.getElementById(‘txtLocation’).color=”blue”
c.         document.getElementById(‘txtLocation’).style.color=”black”
d.        document.getElementById(‘txtLocation’).style.color=”blue”
25. Which of the following enables JavaScript Document Object Model to provide access to the HTTP header?
a.         document.GetHeader()
b.        document.getId(‘header’)
c.         document.getElementByName(‘header’)
d.        document.getElementById(‘header’)
e.         You cannot read the HTTP header information using JavaScript
26. You do not want the end user to see the JavaScript code embedded in the HTML file when the user views the source of the HTML page. Which of the following helps you achieve this?
a.         This is not possible
b.        Use externally linked files which hold the JavaScript code
c.         Modify the headers of the page
d.        Change the MIME type of the page
27. How would you test whether or not a browser window is open?
a.         By using the isOpen method of the window object reference variable
b.        By using the closed property of the window object reference variable
c.         By using the open method of the document object
d.        None of the above
28. You defined two styles as follows: td.right {text-align: right}
td.left {text-align: center}
Which of the following is the right way of calling them in an HTML page?

a.         <td >Some Text</td>
b.        <td >Some Text</td>
c.         <td >Some Text</td>
d.        <td>Some Text</td>
29. You want to shake a link on the mouseover event. If the style position is set to relative and the anchor id is lnk1, which of the following code lines will be useful with a timer?
a.         document.getElementById(‘lnk1′).left=”0″
document.getElementById(‘lnk1′).left=”2″
b.        document.getElementById(‘lnk1′).style.left=”0″
document.getElementById(‘lnk1′).style.left=”2″
c.         document.getElementById(‘lnk1′).style.move=”0″
document.getElementById(‘lnk1′).style.move=”2″
d.        document.getElementById(‘lnk1′).right=”0″
document.getElementById(‘lnk1′).right=”2″
30. Which of the following will you use for changing the color of a button with id=btn, to green on a mouseover event?
a.         btn.color=”green”
b.        document.getElementById(‘btn’).color=”green”
c.         document.getElementById(‘btn’).style.color=”black”
d.        document.getElementById(‘btn’).style.color=”green
31. You are developing an application and there is a possibility of certain users using older browser versions. You want to hide the JavaScript code in the browsers that do not support JavaScript. How would you do this?
a.         Precede the JavaScript statements with //
b.        Precede the JavaScript statements with –
c.         Enclose the statements with /* and */
d.        Use the following notation:
        <script language=”javascript”>
        <!–
        //–>
        </script>
e.         Add a <noscript> tag after the script
32. Consider the following JavaScript alert: <script type=”text/javascript”>
function message()
{
alert(“Welcome to E-Business!!!”)
}
</script>
You want the user to see the above message upon opening the page, how will you implement this?


a.         <body onload=”message()”>
b.        <body onunload=”message()”>
c.         <body onsubmit=”message()”>
d.        <body onready=”message()”>
33. You want to move some selected paragraphs 15px towards the left relative to their normal position. The style definition should be like:
a.         p.relt{ position:relative; left:15px;}
b.        p.relt{ position:relative; left:-15px;}
c.         p{ position:relative; left:15px;}
d.        p{ position:relative; left:-15px;}
34. The width of the h4 is defined as follow: H4 {width:80%;}
How can you make the heading drop shadow?

a.         <h4 filter(shadowdrop)>Heading</h4>
b.        <h4 style=”filter:shadowdrop()”>Heading </h4>
c.         <h4 style=”filter:DropShadow()”>Heading </h4>
d.        <h4 style=”DropShadow ()”>Heading </h4>
e.         <h4 filter(dropshadow)>Heading</h4>
f.         <h4 style=”filter::shadowdrop()”>Heading </h4>
35. When does the load event of the browser occur?
a.         When the browser receives the page header information
b.        When the browser starts displaying the content
c.         When the browser receives all the page information, including framesets
d.        When the browser receives all the page information, including framesets and displays it
e.         None of the above
36. Is the following statement correct? The width of an element must be set for making filters work.

a.         Yes
b.        No
37. You have a function to change the image with id imageID at runtime: function changeimg(givenImg)
{
document.getElementById(‘imageID’).src=givenImg
}
How would you make the webpage display “image2.gif”, only for the time that the user clicks the image?

a.         <img id=”imageID” src=”image1.gif” width=”50″ height=”60″ onmousedown=”changeimg(image1.gif)” onmouseup=”changeimg(image2.gif)”>
b.        <img id=”imageID” src=”image1.gif” width=”50″ height=”60″ onmousedown=”changeimg(image2.gif)” onmouseup=”changeimg(image1.gif)”>
c.         <img id=”imageID” src=”image2.gif” width=”50″ height=”60″ onmousedown=”changeimg(image1.gif)” onmouseup=”changeimg(image2.gif)”>
d.        <img id=”imageID” src=”image2.gif” width=”50″ height=”60″ onmousedown=”changeimg(image2.gif)” onmouseup=”changeimg(image1.gif)”>
38. You want to move all the paragraphs 30px towards the right relative to their normal position. The style definition should be:
a.         p.relt{ position:relative; left:30px;}
b.        p.relt{ position:relative; left:-30px;}
c.         p{ position:relative; left:30px;}
d.        p{ position:relative; left:-30px;}
39. How will you display text as a superscript?
a.         vertical-align: super
b.        vertical-align: superscript
c.         vertical-align: top
d.        text-align: super
e.         text-align: superscript
40. What is the error in the statement var charConvert = toCharCode(‘x’)?
a.         toCharCode() is a bogus method
b.        Nothing. It will work fine
c.         toCharCode accepts only numbers
d.        toCharCode takes no arguments
41. Which of the following enables JavaScript Document Object Model to provide access to the HTTP header?
a.         document.GetHeader()
b.        document.getId(‘header’)
c.         document.getElementByName(‘header’)
d.        document.getElementById(‘header’)
e.         You cannot read the HTTP header information using JavaScript
42. The width of the h4 is defined as follow: H4 {width:80%;}
How can you make the heading drop shadow?

a.         <h4 filter(shadowdrop)>Heading</h4>
b.        <h4 style=”filter:shadowdrop()”>Heading </h4>
c.         <h4 style=”filter:DropShadow()”>Heading </h4>
d.        <h4 style=”DropShadow ()”>Heading </h4>
e.         <h4 filter(dropshadow)>Heading</h4>
f.         <h4 style=”filter::shadowdrop()”>Heading </h4>
43. Which of the following properties of JavaScript is used to store the extra values for DHTML tricks?
a.         DHTML
b.        HTML
c.         innerHTML
d.        outerHTML
44. The width of h3 is defined as follows: H3 {width:90%;}
How can you make the heading flip vertically?

a.         <h3 filter(flip)>Heading</h3>
b.        <h3 style=”filter:flipv()”>Heading </h3>
c.         <h3 style=”filter::flipv()”>Heading </h3>
d.        <h3 style=”FlipvFilter()”>Heading </h3>
45. Which of the following is true?
a.         If onKeyDown returns false, the key-press event is cancelled
b.        If onKeyPress returns false, the key-down event is cancelled
c.         If onKeyDown returns false, the key-up event is cancelled
d.        If onKeyPress returns false, the key-up event is cancelled
46. Your website displays a few articles on java programming. If you want to leave ’1 cm’ space above and below the code blocks, you would use code { margin-top:1cm ; margin-bottom:1cm }.
a.         True
b.        False
47. You want to shake a link on the mouseover event. If the style position is set to relative and the anchor id is lnk1, which of the following code lines will be useful with a timer?
a.         document.getElementById(‘lnk1′).left=”0″
document.getElementById(‘lnk1′).left=”2″
b.        document.getElementById(‘lnk1′).style.left=”0″
document.getElementById(‘lnk1′).style.left=”2″
c.         document.getElementById(‘lnk1′).style.move=”0″
document.getElementById(‘lnk1′).style.move=”2″
d.        document.getElementById(‘lnk1′).right=”0″
document.getElementById(‘lnk1′).right=”2″
48. Which of the following is not a JavaScript event?
a.         ondblclick
b.        onmousemove
c.         onclick
d.        onblink
49. You are developing a website for children. You want to format the borders of big <td> cells (as mentioned below) for some fun game: Left Border:double
Right Border:dashed
Top Border:dotted
Bottom Border:solid
Which of the following would be the correct style definition?

a.         border-style:double dotted dashed solid
b.        border-style:dotted dashed solid double
c.         border-style:dashed double solid dotted
d.        border-style:solid double dotted dashed
50. You are displaying image thumbnails on a page. Upon clicking a thumbnail, the image is being displayed in its actual size. You do not want the user to be able to click the thumbnails unless they are completely downloaded. Which event will you use to prevent the user from clicking on the thumbnails until they are completely downloaded?
a.         OnLoad
b.        OnKeyPress
c.         OnKeyUp
d.        onClick
51. What is the default value for overflow property?
a.         scroll
b.        visible
c.         hidden
d.        auto
52. What is the error in the statement var charConvert = toCharCode(‘x’)?
a.         toCharCode() is a bogus method
b.        Nothing. It will work fine
c.         toCharCode accepts only numbers
d.        toCharCode takes no arguments
53. How would you randomly choose an element from an array named myStuff if the number of elements changes dynamically?
a.         randomElement = myStuff[Math.floor(Math.random() * myStuff.length)];
b.        randomElement = myStuff[Math.ceil(Math.random() * myStuff.length)];
c.         randomElement = myStuff[Math.random(myStuff.length)];
d.        randomElement = myStuff[Math.ceil(Math.random()*myStuff.length - 1)];
54. Which of the following is an important parameter of the wave filter?
a.         WaveSize
b.        Wavelength
c.         Strength
d.        All of the above
55. Consider an HTML form with a checkbox and a text field. When data is entered and the Enter key is pressed, the data seems to be lost before the user can click on the button that calls the processing function. How would you correct this programatically?
a.         Add a TYPE=HIDDEN INPUT to the form
b.        Trap the Enter keypress and return (null)
c.         Add ‘return false’ to onsubmit=”…” in the FORM tag
d.        Instruct the user not to press the Enter key
e.         Modify the ENCTYPE property of the form
56. After clicking on a link, your main browser window spawns a small new window and writes some text on it. When both the window page sources are viewed, the small window page source seems identical to that of the large one. Which of the following makes this happen?
a.         The function writing to the new window did not close the document stream
b.        Windows receive the source code of the window that wrote to them
c.         Since the new window has no filename, it receives the source code of its parent
d.        None of the above
57. Choose another way to write x ? a = b : a = c
a.         if (‘x’) { a = b; } else { a = c; }
b.        if (x) { a = c; } else { a = b; }
c.         x : a = c ? a = b
d.        None of the above
58. You are required to create a web page in which hyperlinked sub-headings are displayed. On clicking a link, the contents should get displayed dynamically. Which of the following style attributes would you use for this?
a.         visibility:hidden;
b.        visibility:display;
c.         visibility:visible;
d.        visibility:none;
59. Following is a sample CSS style: 1. p
2. (
3. font-family:arial
4. color:black
5. text-align:left
6. );
What are the corrections required in this style?


a.         The style definition should be enclosed in curly braces
b.        Multiple items within a style should be separated by “;”
c.         The style should not close with a semicolon
d.        All of the above
60. Which of the following is not a CSS filter?
a.         alpha
b.        beta
c.         xray
d.        invert
61. Which of the following is not a JavaScript event?
a.         onabort
b.        onchange
c.         onupdate
d.        onkeydown
62. You want to delete an element from an options array. How would you do it?
a.         Set it to false
b.        Set it to null
c.         Set it to undefined
d.        Set it to -1
e.         Set it to 0
f.         Set it to 1
63. Which of the following styles will be helpful in keeping an image at a fixed position on the webpage, even if someone scrolls the page?
a.         background-style:fixed;
b.        background-style:static;
c.         background-attachment:fixed;
d.        background-attachment:static;
64. You have created an object. How can you add a property to the object class?
a.         With the prototype() method
b.        With the prototype property
c.         It cannot be done
d.        With the this object
65. You want to validate the value in a field as soon as the user moves out of the field by pressing the tab key. Which of the following events would you use?
a.         onblur
b.        onfocus
c.         lostfocus
d.        gotfocus
e.         None of the above
66. Which of the following is not a JavaScript event?
a.         onmouseover
b.        onmouseout
c.         onmousepress
d.        onmousedown
67.*** A DHTML page contains a table in between some text. You want to shift the table 20 pixels on the right to separate it from text. Which of the following styles would be suitable for the purpose?

a.         position:relative;
left:20PX;
b.        position:relative;
left:-20PX;
c.         position:relative;
right:-20PX;
d.        position:relative;
right:20PX;
68. When does the load event of the browser occur?
a.         When the browser receives the page header information
b.        When the browser starts displaying the content
c.         When the browser receives all the page information, including framesets
d.        When the browser receives all the page information, including framesets and displays it
e.         None of the above
69. Consider the three variables: someText = ‘JavaScript1.2′;
pattern = /(\w+)(\d)\.(\d)/i;
outCome = pattern.exec(someText);
What does pattern.ignoreCase contain?

a.         true
b.        false
c.         undefined
d.        null
e.         0
70. You want to move some selected paragraphs 15px towards the left relative to their normal position. The style definition should be like:
a.         p.relt{ position:relative; left:15px;}
b.        p.relt{ position:relative; left:-15px;}
c.         p{ position:relative; left:15px;}
d.        p{ position:relative; left:-15px;}
71. An HTML form has 10 checkboxes which are all named “chkItems”. Which JavaScript function can be used for checking all the checkboxes together?

a.         function CheckAll()
{
for (z = 0; z < document.forms.chkItems.length; z++)
{
document.forms.chkItems[z].checked=true
}
}
b.        function CheckAll()
{
        for (z = 0; z < document.forms[0].chkItems.length; z++)
        {
        document.forms[0].chkItems[z].checked=true
        }
}
c.         function CheckAll()
{
for (z = 0; z < document.forms[0].chkItems.length; z++)
{
document.forms[0].chkItems.list[z].checked=true
}
}
d.        function CheckAll()
{
for (z = 0; z < document.forms[0].chkItems.length; z++)
{
document.forms[0].chkItems.list[z].checked=false
}
}
72. What is the default value for z-index?
a.         -1
b.        1
c.         0
d.        null
e.        auto
73. Which of the following code snippets is more effective? Why is it so? <script language=”javascript”>
for(i=0;i<document.images.length;i++)
document.images[i].src=”blank.gif”;
</script>
<script language=”javascript”>
var theimages = document.images;
for(i=0;i<theimages.length;i++)
theimages[i].src=”blank.gif”
</script>


a.         Both are equally effective
b.        The first code is more effective as it contains less code
c.         The first code is more effective as it employs object caching
d.        The second code is more effective as it employs object caching
74. How will you change the color of the paragraph text to blue on placing the mouse over the paragraph, and reset it back when the mouse leaves the paragraph?
a.         <p onmouseover=”style.color=’black’” onmouseout=”style.color=’blue’”> The text of the paragraph..</p>
b.        <p onmouseover=”style.color=’blue’” onmouseout=”style.color=’black’”> The text of the paragraph..</p>
c.         <p onmouseout=”style.color=’blue’”> The text of the paragraph..</p>
d.        <p onmouseover=”style.color=’blue’”> The text of the paragraph..</p>
75. How can you use a timer with a function called rearrange()?
a.         tmr=setTimeout(“rearrange()”,1)
b.        tmr=Timer(1,”rearrange()”)
c.         tmr=Timer(“rearrange()”,1)
d.        tmr=setTimeout(1,”rearrange()”)
76. How would you test whether or not a browser window is open?
a.         By using the isOpen method of the window object reference variable
b.        By using the closed property of the window object reference variable
c.         By using the open method of the document object
d.        None of the above
77. You are setting cookies with JavaScript. What happens to cookies.txt data if the file exceeds the maximum size?
a.         Your script automatically generates a run-time error
b.        Your script automatically generates a load-time error
c.         The file is truncated to the maximum length
d.        None of the above
78. Consider the following validate function: <script type=”text/javascript”>
function ValidateField()
{
if(document.forms[0].txtId.value ==”")
{return false;}
return true;
}
</script>
This function should be called as soon as the user leaves the field. What will you do?


a.         <input name=txtId type=”text” onreset=”return ValidateField()”>
b.        <input name=txtId type=”text” onfocus=”return ValidateField()”>
c.         <input name=txtId type=”text” onsubmit=”return ValidateField()”>
d.        <input name=txtId type=”text” onblur=”return ValidateField()”>
79. You are developing an application and there is a possibility of certain users using older browser versions. You want to hide the JavaScript code in the browsers that do not support JavaScript. How would you do this?
a.         Precede the JavaScript statements with //
b.        Precede the JavaScript statements with –
c.         Enclose the statements with /* and */
d.        Use the following notation:
        <script language=”javascript”>
        <!–
        //–>
        </script>
            e.         Add a <noscript> tag after the script
80. You are formatting your error messages using the following inline style definition: <span style=”color: red”>Error message.</span>
Now you want the error message text to be displayed in blue color. But the problem is that you are not permitted to edit the HTML code, you can only edit the imported style sheet. Which style definition will you use in the imported style sheet to achieve this?

a.         span.error{color: blue;}
b.        span.error{ color: blue !important;}
c.         span.error{ color: blue !inherit;}
d.        It is impossible. Inline styles always override imported styles
81. An HTML form has 10 checkboxes which are all named “chkItems”. Which JavaScript function can be used for checking all the checkboxes together?
a.         function CheckAll()
{
for (z = 0; z < document.forms.chkItems.length; z++)
{
document.forms.chkItems[z].checked=true
}
}
b.        function CheckAll()
{
        for (z = 0; z < document.forms[0].chkItems.length; z++)
        {
        document.forms[0].chkItems[z].checked=true
        }
}
c.         function CheckAll()
{
for (z = 0; z < document.forms[0].chkItems.length; z++)
{
document.forms[0].chkItems.list[z].checked=true
}
}
d.        function CheckAll()
{
for (z = 0; z < document.forms[0].chkItems.length; z++)
{
document.forms[0].chkItems.list[z].checked=false
}
}
82. How can you change the image position from  relative to absolute if the image id is “ERImage”?
a.         document.getElementById(‘ERImage’).position=”absolute”
b.        document.getElementById(‘ERImage’).setAttribute(position, “absolute”)
c.         document.getElementById(‘ERImage’).style.position=”absolute;”
d.        document.getElementById(‘ERImage’).style.position=”absolute”
83. How will you display text as a superscript?
a.         vertical-align: super
b.        vertical-align: superscript
c.         vertical-align: top
d.        text-align: super
e.         text-align: superscript
84. What is the error in the statement var charConvert = toCharCode(‘x’)?
a.         toCharCode() is a bogus method
b.        Nothing. It will work fine
c.         toCharCode accepts only numbers
d.        toCharCode takes no arguments
85. Which of the following statements with regard to CSS is correct?
a.         The positioning can be absolute, relative, or dynamic
b.        The float property for text/image can be left, right, or center
c.         The values for visibility can be true or false
d.        The display property sets how an element is displayed
86. Which of the following code snippets is more efficient and why? <script language=”javascript”>
for(i=0;i<document.images.length;i++)
document.images[i].src=”blank.gif”;
</script>
<script language=”javascript”>
var theimages = document.images;
for(i=0;i<theimages.length;i++)
theimages[i].src=”blank.gif”
</script>


a.         Both are equally efficient
b.        The first code is more efficient as it contains less coding
c.         The first code is more efficient as it employs object caching
d.        The second code is more efficient as it employs object caching
87. You defined two styles as follows: td.right {text-align: right}
td.left {text-align: center}
Which of the following is the right way of calling them in an HTML page?

a.         <td >Some Text</td>
b.        <td >Some Text</td>
c.         <td >Some Text</td>
d.        <td >Some Text</td>
88. You are developing a website for children. You want to format the borders of big <td> cells (as mentioned below) for some fun game: Left Border:double
Right Border:dashed
Top Border:dotted
Bottom Border:solid
Which of the following would be the correct style definition?

a.         border-style:double dotted dashed solid
b.        border-style:dotted dashed solid double
c.         border-style:dashed double solid dotted
d.        border-style:solid double dotted dashed
89.  You declared an array as follows: var arr;
What value would JavaScript assign to an uninitialized element of this array?

a.         NaN
b.        null
c.         undefined
d.        false
e.         0
90. You are required to create a web page in which hyperlinked sub-headings are displayed. On clicking a link, the contents should get displayed dynamically. Which of the following style attributes would you use for this?
a.         visibility:hidden;
b.        visibility:display;
c.         visibility:visible;
d.        visibility:none;
91. You have defined an image tag as follows: <img id=”ERImage” width=”100″ height=”100″ onmouseover=”ImageChange()” src=”Image1.jpg”>
How would you implement ImageChange() function, if the new image to be set for mouseover is Image2.jpg?

a.         document.getElementById(‘ERImage’).src=”Image1.jpg”
b.        document.getElementById(‘ERImage’).src=”Image2.jpg”
c.         document.getElementById(‘ERImage’).style.src=”Image1.jpg”
d.        document.getElementById(‘ERImage’).style.src=”Image2.jpg”
92. You want to shake a link on the mouseover event. If the style position is set to relative and the anchor id is lnk1, which of the following code lines will be useful with a timer?
a.         document.getElementById(‘lnk1′).left=”0″
document.getElementById(‘lnk1′).left=”2″
b.        document.getElementById(‘lnk1′).style.left=”0″
document.getElementById(‘lnk1′).style.left=”2″
c.         document.getElementById(‘lnk1′).style.move=”0″
document.getElementById(‘lnk1′).style.move=”2″
d.        document.getElementById(‘lnk1′).right=”0″
document.getElementById(‘lnk1′).right=”2″
93. The width of the h4 is defined as follow: H4 {width:80%;}
How can you make the heading drop shadow?

a.         <h4 filter(shadowdrop)>Heading</h4>
b.        <h4 style=”filter:shadowdrop()”>Heading </h4>
c.         <h4 style=”filter:DropShadow()”>Heading </h4>
d.        <h4 style=”DropShadow ()”>Heading </h4>
e.         <h4 filter(dropshadow)>Heading</h4>
f.         <h4 style=”filter::shadowdrop()”>Heading </h4>
94. Which of the following is an important parameter of the wave filter?
a.         WaveSize
b.        Wavelength
c.         Strength
d.        All of the above
95. After clicking on a link, your main browser window spawns a small new window and writes some text on it. When both the window page sources are viewed, the small window page source seems identical to that of the large one. Which of the following makes this happen?
a.         The function writing to the new window did not close the document stream
b.        Windows receive the source code of the window that wrote to them
c.         Since the new window has no filename, it receives the source code of its parent
d.        None of the above
96. Is the following statement correct?
The width of an element must be set for making filters work.


a.         Yes
b.        No
97. The anchor tag is defined as follows: <a href=”http://expertrating.com”>expertrating</a>
Which of the following styles will make convert this to capital letters on mouseover?

a.         a:hover { text:ucase;}
b.        a:hover { text-style:uppercase;}
c.         a:hover { text-transform:uppercase;}
d.        a:hover { text-style:upper;}
98. Which of the following will you use for changing the color of a button with id=btn, to green on a mouseover event?
a.         btn.color=”green”
b.        document.getElementById(‘btn’).color=”green”
c.         document.getElementById(‘btn’).style.color=”black”
d.        document.getElementById(‘btn’).style.color=”green”
99. You do not want the end user to see the JavaScript code embedded in the HTML file when the user views the source of the HTML page. Which of the following helps you achieve this?
a.         This is not possible
b.        Use externally linked files which hold the JavaScript code
c.         Modify the headers of the page
d.        Change the MIME type of the page
100. Consider the following validate function: <script type=”text/javascript”>
function ValidateField()
{
if(document.forms[0].txtId.value ==”")
{return false;}

return true;
}
</script>
This function should be called as soon as the user leaves the field. What will you do?

a.         <input name=txtId type=”text” onreset=”return ValidateField()”>
b.        <input name=txtId type=”text” onfocus=”return ValidateField()”>
c.         <input name=txtId type=”text” onsubmit=”return ValidateField()”>
d.        <input name=txtId type=”text” onblur=”return ValidateField()”>
101. Which of the following is not a JavaScript event?
a.         onabort
b.        onchange
c.         onupdate
d.        onkeydown
102. Which of the following is not a JavaScript event?
a.         ondblclick
b.        onmousemove
c.         onclick
d.        onblink
103. While coding a loop, you come across a condition where you have to ignore the rest of the statements and continue with the beginning of the loop. Which of the following statements would you use?
a.         exit
b.        return
c.         continue
d.        while
e.         break
104. Given below is a window.open function: window.open(url,name,”attributes”)
How will you ensure that different URLs open in the same window?

a.         By keeping the second attribute name same
b.        By nullifying the name attribute
c.         By omitting the name attribute
d.        None of the above
105. You want to move some selected paragraphs 15px towards the left relative to their normal position. The style definition should be like:
a.         p.relt{ position:relative; left:15px;}
b.        p.relt{ position:relative; left:-15px;}
c.         p{ position:relative; left:15px;}
d.        p{ position:relative; left:-15px;}
106. Which of the following is used to display an image behind the paragraph text?
a.         set negative z-index for the image
b.        set positive z-index for the image
c.         set negative z-index for the paragraph
d.        set positive z-index for the paragraph
e.         set z-index=0 for the paragraph
f.         set z-index=0 for the image
107.  You have this image definition: <img id=”logo” src=”companylogo1.gif” height=”12″ width=”12″ >
Which of the following would be helpful for changing the image to “companylogo2.gif” on page load?

a.         logo.source=”companylogo2.gif”
b.        logo.source=”companylogo1.gif”
c.         document.getElementById(‘logo’).src=”companylogo1.gif”
d.        document.getElementById(‘logo’).src=”companylogo2.gif”
108. For making the text transparent, the mask filter can be used like:
a.         mask(color=#ff00ff)
b.        mask(color=#ffffff)
c.         mask(#ffffff)
d.        mask(#ff00ff)
109. Which of the following in-built functions is useful when you want to access a form element using its id?
a.         getItem(id)
b.        getFormElement(id)
c.         getElementById(id)
d.        All of the above
110. How would you double the image size of an Image on a mouseover event, if the original width and height are 100px and id is logo?
a.         document.getElementById(‘logo’).style.width=”200″
 document.getElementById(‘logo’).style.height=”200″
b.        document.getElementById(‘logo’).style.width=”100″
document.getElementById(‘logo’).style.height=”100″
c.         document.getElementById(‘logo’).width=”200″
document.getElementById(‘logo’).height=”200″
d.        document.getElementById(‘logo’).width=”200px”
document.getElementById(‘logo’).height=”200px”
111. You are displaying image thumbnails on a page. Upon clicking a thumbnail, the image is being displayed in its actual size. You do not want the user to be able to click the thumbnails unless they are completely downloaded. Which event will you use to prevent the user from clicking on the thumbnails until they are completely downloaded?
a.         OnLoad
b.        OnKeyPress
c.         OnKeyUp
d.        onClick
112.  How is the following code useful? function validate(field)
{
var valid=”ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz”;
var ok=”yes”;
var temp;
for(var i=0; i < field.value.length; i++)
{
temp=”" + field.value.substring(i,i+1)
if(valid.indexOf(temp)==”-1″)
{
ok=”no”;
break;
}
}
if(ok==”no”)
{
alert(“error”);
field.focus();
}
}

a.         It will force a user to enter only numeric values
b.        It will force a user to enter only alphanumeric values
c.         It will force a user to enter only character values
d.        None of the above
113. You are designing a web site and need to set the background image for all the web pages. You want a small background image to repeat and fill up the whole background. Which of the following body styles is ideal for this?
a.         body { background: url(/images/bg.gif);
repeat: repeat-x }
b.        body { background: url(/images/bg.gif);
repeat: repeat-y }
c.         body { background-image: url(/images/bg.gif);
background-repeat: no-repeat }
d.        body { background-image: url(/images/bg.gif);}
114. Which of the following helps you create hyperlinks without an underline?
a.         a{text-decoration:none}
b.        a{text-decoration:noline}
c.         a{text-decoration:hide}
d.        a{text-decoration:invisible}
e.         a{ font-style: normal;}
f.         a{font-style: none;}
115. You are formatting your error messages using the following inline style definition: <span style=”color: red”>Error message.</span>
Now you want the error message text to be displayed in blue color. But the problem is that you are not permitted to edit the HTML code, you can only edit the imported style sheet. Which style definition will you use in the imported style sheet to achieve this?

a.         span.error{color: blue;}
b.        span.error{ color: blue !important;}
c.         span.error{ color: blue !inherit;}
d.        It is impossible. Inline styles always override imported styles
116.  The width of h3 is defined as follow: H3 {width:100%;}
How can you make the heading glow?

a.         <h3 filter(glow)>Heading</h3>
b.        <h3 style=”filter:glow()”>Heading </h3>
c.         <h3 style=”filter::glow()”>Heading </h3>
d.        <h3 style=”GlowFilter()”>Heading </h3>
117.  The following code snippet is used in form validation, the validate function is supposed to return a true if all validations are successful and false if the validation fails. However, the data is always submitted even if the validation fails, what could the cause be? <form name=”frmadd” method=”post” action=”add.asp” onsubmit=”validate()”>

a.         There is no error, the code is fine
b.        There should be a return statement before the call to the validate function
c.         onsubmit=”validate()” should be replaced with “javascript:validate()”
118. The following statements show two ways of calling a JavaScript function: i)onclick = “a()”
ii)onclick=”javascript:a()”
a() refers to a function written in JavaScript.
Which of the following statements is correct with regard to the above two statements?

a.         There is no difference between the two statements
b.        The first statement is incorrect and the second one is correct
119. How will you change the color of the paragraph text to blue on placing the mouse over the paragraph, and reset it back when the mouse leaves the paragraph?
a.         <p onmouseover=”style.color=’black’” onmouseout=”style.color=’blue’”> The text of the paragraph..</p>
b.        <p onmouseover=”style.color=’blue’” onmouseout=”style.color=’black’”> The text of the paragraph..</p>
c.         <p onmouseout=”style.color=’blue’”> The text of the paragraph..</p>
d.        <p onmouseover=”style.color=’blue’”> The text of the paragraph..</p>
120. Which of the following is not a JavaScript event?
a.         onmouseover
b.        onmouseout
c.         onmousepress
d.        onmousedown
121. An HTML form has 10 checkboxes which are all named “chkItems”. Which JavaScript function can be used for checking all the checkboxes together?

a.         function CheckAll()
{
for (z = 0; z < document.forms.chkItems.length; z++)
{
document.forms.chkItems[z].checked=true
}
}
b.        function CheckAll()
{
        for (z = 0; z < document.forms[0].chkItems.length; z++)
        {
        document.forms[0].chkItems[z].checked=true
        }
}
c.         function CheckAll()
{
for (z = 0; z < document.forms[0].chkItems.length; z++)
{
document.forms[0].chkItems.list[z].checked=true
}
}
d.        function CheckAll()
{
for (z = 0; z < document.forms[0].chkItems.length; z++)
{
document.forms[0].chkItems.list[z].checked=false
}
}
122. For making the text transparent, the mask filter can be used like:
a.         mask(color=#ff00ff)
b.        mask(color=#ffffff)
c.         mask(#ffffff)
d.        mask(#ff00ff)
123. Which of the following code snippets is more effective? Why is it so? <script language=”javascript”>
for(i=0;i<document.images.length;i++)
document.images[i].src=”blank.gif”;

</script>
<script language=”javascript”>
var theimages = document.images;
for(i=0;i<theimages.length;i++)
theimages[i].src=”blank.gif”
</script>

a.         Both are equally effective
b.        The first code is more effective as it contains less code
c.         The first code is more effective as it employs object caching
d.        The second code is more effective as it employs object caching
124. Which of the following is not a JavaScript event?
a.         onmouseover
b.        onmouseout
c.         onmousepress
d.        onmousedown
125. The width of the h4 is defined as follow: H4 {width:95%;}
How can you make the heading blur?

a.         <h4 filter(blur)>Heading</h42>
b.        <h4 style=”filter:blur()”>Heading </h4>
c.         <h4 style=”filter::blur()”>Heading </h4>
d.        <h4 style=”Blur()”>Heading </h4>
126. You are required to create a web page in which hyperlinked sub-headings are displayed. On clicking a link, the contents should get displayed dynamically. Which of the following style attributes would you use for this?
a.         visibility:hidden;
b.        visibility:display;
c.         visibility:visible;
d.        visibility:none;
127. You want to position a heading at 15 pixels from the left of the page and 20 pixels from the top of the page. The style definition should be:
a.         h2.side{ position:relative;  left:15px; top:20px;}
b.        h2.side{ position:absolute; left:15px; top:20px;}
c.         h2{ position:relative; left:15px; top:20px;}
d.        h2{ position:absolute; left:15px; top:20px;}
128. You want to move all the paragraphs 30px towards the right relative to their normal position. The style definition should be:
a.         p.relt{ position:relative; left:30px;}
b.        p.relt{ position:relative; left:-30px;}
c.         p{ position:relative; left:30px;}
d.        p{ position:relative; left:-30px;}
129. Is the following statement correct? The width of an element must be set for making filters work.

a.         Yes
b.        No
130. Which of the following in-built functions is useful when you want to access a form element using its id?
a.         getItem(id)
b.        getFormElement(id)
c.         getElementById(id)
d.        All of the above
131. You want to move some selected paragraphs 15px towards the left relative to their normal position. The style definition should be like:
a.         p.relt{ position:relative; left:15px;}
b.        p.relt{ position:relative; left:-15px;}
c.         p{ position:relative; left:15px;}
d.        p{ position:relative; left:-15px;}
132. While coding a loop, you come across a condition where you have to ignore the rest of the statements and continue with the beginning of the loop. Which of the following statements would you use?
a.         exit
b.        return
c.         continue
d.        while
e.         break
133. Given below is a window.open function: window.open(url,name,”attributes”)
How will you ensure that different URLs open in the same window?

a.         By keeping the second attribute name same
b.        By nullifying the name attribute
c.         By omitting the name attribute
d.        None of the above
134. This is a JavaScript function for changing the color of the text box named “txtName”: function SetColor(col)
{ document.forms[0].txtName.style.background=col }
How will you change the color of the text box txtName to green, only for the time that the user is pressing any key?

a.         <input type=”text” onkeydown=”SetColor(‘white’)” onkeyup=”SetColor(‘green’)” name=”txtName”>
b.        <input type=”text” onkeydown=”SetColor(‘green’)” onkeyup=”SetColor(‘white’)” name=”txtName”>
c.         <input type=”text” onkeydown=”SetColor(‘green’)” name=”txtName”>
d.        <input type=”text” onkeydown=”SetColor(‘white’)” name=”txtName”>
135. You have a function to change the image with id imageID at runtime: function changeimg(givenImg)
{
document.getElementById(‘imageID’).src=givenImg
}
How would you make the webpage display “image2.gif”, only for the time that the user clicks the image?

a.         <img id=”imageID” src=”image1.gif” width=”50″ height=”60″ onmousedown=”changeimg(image1.gif)” onmouseup=”changeimg(image2.gif)”>
b.        <img id=”imageID” src=”image1.gif” width=”50″ height=”60″ onmousedown=”changeimg(image2.gif)” onmouseup=”changeimg(image1.gif)”>
c.         <img id=”imageID” src=”image2.gif” width=”50″ height=”60″ onmousedown=”changeimg(image1.gif)” onmouseup=”changeimg(image2.gif)”>
d.        <img id=”imageID” src=”image2.gif” width=”50″ height=”60″ onmousedown=”changeimg(image2.gif)” onmouseup=”changeimg(image1.gif)”>
136. You defined two styles as follows: td.right {text-align: right}
td.left {text-align: center}
Which of the following is the right way of calling them in an HTML page?

a.         <td >Some Text</td>
b.        <td >Some Text</td>
c.         <td >Some Text</td>
d.        <td >Some Text</td>
137. You want to position all the h2 headings on the page at 15 pixels from the left of page and 20 pixels from the top of the page. The style definition should be:
a.         h2.side{ position:relative;  left:15px; top:20px;}
b.        h2.side{ position:absolute; left:15px; top:20px;}
c.         h2{ position:relative; left:15px; top:20px;}
d.        h2{ position:absolute; left:15px; top:20px;}
138. You are developing a website for children. You want to format the borders of big <td> cells (as mentioned below) for some fun game: Left Border:double
Right Border:dashed
Top Border:dotted
Bottom Border:solid
Which of the following would be the correct style definition?

a.         border-style:double dotted dashed solid
b.        border-style:dotted dashed solid double
c.         border-style:dashed double solid dotted
d.        border-style:solid double dotted dashed
139. Which of the following style properties is used to display only a part of an image?
a.         snap
b.        clip
c.         scroll
d.        visible
e.         overflow
f.         size
140. How would you randomly choose an element from an array named myStuff if the number of elements changes dynamically?
a.         randomElement = myStuff[Math.floor(Math.random() * myStuff.length)];
b.        randomElement = myStuff[Math.ceil(Math.random() * myStuff.length)];
c.         randomElement = myStuff[Math.random(myStuff.length)];
d.        randomElement = myStuff[Math.ceil(Math.random()*myStuff.length - 1)];
141. Which of the following is used to display an image behind the paragraph text?
a.         set negative z-index for the image
b.        set positive z-index for the image
c.         set negative z-index for the paragraph
d.        set positive z-index for the paragraph
e.         set z-index=0 for the paragraph
f.         set z-index=0 for the image
142. Which of the following is not a JavaScript event?
a.         onabort
b.        onchange
c.         onupdate
d.        onkeydown
143. Which of the options is true for the following style, if h2 and h3 will be positioned on the top of each other? h2{z-index:1;}
h3{z-index:2;}

a.         h2 will be on the top of h3
b.        h3 will be on the top of h2
c.         h3 will be on the right of h2
d.        h2 will be on the right of h3
144. Which of the following can you use to accept user input?
a.         The prompt method
b.        The alert method
c.         A form field
d.        The confirm method
145. The width of H1 is defined as follows: H1 {width:100px;}
How can you make the heading flip horizontally?

a.         <h1 filter(flip)>Heading</h1>
b.        <h1 style=”filter::fliph()”>Heading</h1>
c.         <h1 style=”filter:fliph()”>Heading</h1>
d.        <h1 style=”FliphFilter()”>Heading</h1>
146. What does the following code snippet do? <input type=”radio” name=”r1″ value=”radio1″ onclick=”this.checked=false;alert(‘sorry’)”>

a.         The code is incorrect
b.        The code makes it necessary for the user to select the radio button
c.         The code disables the radio button
d.        The code displays an alert when the user selects the button
147. Which of the following properties of JavaScript is used to store the extra values for DHTML tricks?
a.         DHTML
b.        HTML
c.         innerHTML
d.        outerHTML
148. How will you change the color of the paragraph text to blue on placing the mouse over the paragraph, and reset it back when the mouse leaves the paragraph?
a.         <p onmouseover=”style.color=’black’” onmouseout=”style.color=’blue’”> The text of the paragraph..</p>
b.        <p onmouseover=”style.color=’blue’” onmouseout=”style.color=’black’”> The text of the paragraph..</p>
c.         <p onmouseout=”style.color=’blue’”> The text of the paragraph..</p>
d.        <p onmouseover=”style.color=’blue’”> The text of the paragraph..</p>
149. Which of the following will you use for changing the color of the textbox text with id=txtLocation to blue, on a mouseover event?
a.         txtLocation.color=”blue”
b.        document.getElementById(‘txtLocation’).color=”blue”
c.         document.getElementById(‘txtLocation’).style.color=”black”
d.        document.getElementById(‘txtLocation’).style.color=”blue”
150. How is the following code useful? function validate(field)
{
var valid=”ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz”;
var ok=”yes”;
var temp;

for(var i=0; i < field.value.length; i++)
{
temp=”" + field.value.substring(i,i+1)
if(valid.indexOf(temp)==”-1″)
{
ok=”no”;
break;
}
}
if(ok==”no”)
{
alert(“error”);
field.focus();
}
}

a.         It will force a user to enter only numeric values
b.        It will force a user to enter only alphanumeric values
c.         It will force a user to enter only character values
d.        None of the above
151. You have created an object. How can you add a property to the object class?
a.         With the prototype() method
b.        With the prototype property
c.         It cannot be done
d.        With the this object
152. You declared an array as follows: var arr;
What value would JavaScript assign to an uninitialized element of this array?

a.         NaN
b.        null
c.         undefined
d.        false
e.         0
153. The width of h3 is defined as follows: H3 {width:90%;}
How can you make the heading flip vertically?

a.         <h3 filter(flip)>Heading</h3>
b.        <h3 style=”filter:flipv()”>Heading </h3>
c.         <h3 style=”filter::flipv()”>Heading </h3>
d.        <h3 style=”FlipvFilter()”>Heading </h3>
154. Which of the following code snippets is more efficient and why? <script language=”javascript”>
for(i=0;i<document.images.length;i++)
document.images[i].src=”blank.gif”;
</script>
<script language=”javascript”>
var theimages = document.images;
for(i=0;i<theimages.length;i++)
theimages[i].src=”blank.gif”
</script>

a.         Both are equally efficient
b.        The first code is more efficient as it contains less coding
c.         The first code is more efficient as it employs object caching
d.        The second code is more efficient as it employs object caching
155. You want to display an alert that contains a ‘ (single-quote) character. Which of the following characters would you use to escape the ‘ character?
a.         *
b.        \
c.         /
d.        _
e.         #
f.         %
g.         |
h.        ~
156. How can you use a timer with a function called rearrange()?
a.         tmr=setTimeout(“rearrange()”,1)
b.        tmr=Timer(1,”rearrange()”)
c.         tmr=Timer(“rearrange()”,1)
d.        tmr=setTimeout(1,”rearrange()”)
157. The anchor tag is defined as follows: <a href=”http://expertrating.com”>expertrating</a>
Which of the following styles will increase the spacing between letters on mouseover?

a.         a:hover { spacing: 1px;}
b.        a:hover { spacing: 2px;}
c.         a:hover { letter-spacing: 0;}
d.        a:hover { letter-spacing: 2px;}
158. Which of the following is an important parameter of the wave filter?
a.         WaveSize
b.        Wavelength
c.         Strength
d.        All of the above
159. You want to validate the value in a field as soon as the user moves out of the field by pressing the tab key. Which of the following events would you use?
a.         onblur
b.        onfocus
c.         lostfocus
d.        gotfocus
e.         None of the above
160. Which of the following helps you create hyperlinks without an underline?
a.         a{text-decoration:none}
b.        a{text-decoration:noline}
c.         a{text-decoration:hide}
d.        a{text-decoration:invisible}
e.         a{ font-style: normal;}
f.         a{font-style: none;}
161. While coding a loop, you come across a condition where you have to ignore the rest of the statements and continue with the beginning of the loop. Which of the following statements would you use?
a.         exit
b.        return
c.         continue
d.        while
e.         break
162. How is the following code useful? function validate(field)
{
var valid=”ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz”;
var ok=”yes”;
var temp;
for(var i=0; i < field.value.length; i++)
{
temp=”" + field.value.substring(i,i+1)
if(valid.indexOf(temp)==”-1″)
{
ok=”no”;
break;
}
}
if(ok==”no”)
{
alert(“error”);
field.focus();
}
}

a.         It will force a user to enter only numeric values
b.        It will force a user to enter only alphanumeric values
c.         It will force a user to enter only character values
d.        None of the above
163. A DHTML page contains a table in between some text. You want to shift the table 20 pixels on the right to separate it from text. Which of the following styles would be suitable for the purpose?
a.         position:relative;
left:20PX;
b.        position:relative;
left:-20PX;
c.         position:relative;
right:-20PX;
d.        position:relative;
right:20PX;
164. If an image is placed styled with z-index=-1 and a text paragraph is overlapped with it. Which one will come on top?
a.         paragraph
b.        image
c.         any of the above
165. You are developing an application and there is a possibility of certain users using older browser versions. You want to hide the JavaScript code in the browsers that do not support JavaScript. How would you do this?

a.         Precede the JavaScript statements with //
b.        Precede the JavaScript statements with –
c.         Enclose the statements with /* and */
d.        Use the following notation:
        <script language=”javascript”>
        <!–
        //–>
        </script>
e.         Add a <noscript> tag after the script
166. You have a button definition as given below: <input type=”button” value=”Calculate”>
To load an image “Img2.jpg” as the background of the button on a mouseover event, you can use:

a.         event.srcElement.style.backgroundImage=”Img2.jpg”
b.        event.srcElement.style.Image=”Img2.jpg”
c.         event.srcElement.style.backgroundImage=”url(‘Img2.jpg’)”
d.        event.srcElement.style.Image=”url(‘Img2.jpg’)”
167. Consider an HTML form with a checkbox and a text field. When data is entered and the Enter key is pressed, the data seems to be lost before the user can click on the button that calls the processing function. How would you correct this programatically?
a.         Add a TYPE=HIDDEN INPUT to the form
b.        Trap the Enter keypress and return (null)
c.         Add ‘return false’ to onsubmit=”…” in the FORM tag
d.        Instruct the user not to press the Enter key
e.         Modify the ENCTYPE property of the form
168. You are formatting your error messages using the following inline style definition: <span style=”color: red”>Error message.</span>
Now you want the error message text to be displayed in blue color. But the problem is that you are not permitted to edit the HTML code, you can only edit the imported style sheet. Which style definition will you use in the imported style sheet to achieve this?

a.         span.error{color: blue;}
b.        span.error{ color: blue !important;}
c.         span.error{ color: blue !inherit;}
d.        It is impossible. Inline styles always override imported styles
169. What is the default value for overflow property?
a.         scroll
b.        visible
c.         hidden
d.        auto
170. You do not want the end user to see the JavaScript code embedded in the HTML file when the user views the source of the HTML page. Which of the following helps you achieve this?
a.         This is not possible
b.        Use externally linked files which hold the JavaScript code
c.         Modify the headers of the page
d.        Change the MIME type of the page
171. Which of the options is true for the following style, if h2 and h3 will be positioned on the top of each other? h2{z-index:1;}
h3{z-index:2;}

a.         h2 will be on the top of h3
b.        h3 will be on the top of h2
c.         h3 will be on the right of h2
d.        h2 will be on the right of h3
172. An HTML form has 10 checkboxes which are all named “chkItems”. Which JavaScript function can be used for checking all the checkboxes together?
a.         function CheckAll()
{
for (z = 0; z < document.forms.chkItems.length; z++)
{
document.forms.chkItems[z].checked=true
}
}
b.        function CheckAll()
{
for (z = 0; z < document.forms[0].chkItems.length; z++)
{
document.forms[0].chkItems[z].checked=true
}
}
c.         function CheckAll()
{
for (z = 0; z < document.forms[0].chkItems.length; z++)
{
document.forms[0].chkItems.list[z].checked=true
}
}
d.        function CheckAll()
{
for (z = 0; z < document.forms[0].chkItems.length; z++)
{
document.forms[0].chkItems.list[z].checked=false
}
}
173. You have embedded the document.write() method to write some text within a pair of <TD></TD> table tags. On loading the file, you get some garbled junk on the page that should contain the text. What makes this happen?
a.         The browser does not support JavaScript
b.        You are using an outdated version of the browser
c.         The browser does not support cookies
d.        None of the above
174. The width of the h4 is defined as follow: H4 {width:95%;}
How can you make the heading blur?

a.         <h4 filter(blur)>Heading</h42>
b.        <h4 style=”filter:blur()”>Heading </h4>
c.         <h4 style=”filter::blur()”>Heading </h4>
d.        <h4 style=”Blur()”>Heading </h4>
175. Given below is a window.open function:
window.open(url,name,”attributes”)

How will you ensure that different URLs open in the same window?


a.         By keeping the second attribute name same
b.        By nullifying the name attribute
c.         By omitting the name attribute
d.        None of the above
176. You developed a web page using HTML and style sheets. You defined H4 style in the head tag, imported style sheet, as well as inline. Which of the following style definitions is used when the page is rendered in a browser?
a.         Default browser H4 definition
b.        External style sheet definition
c.         Inline style definition
d.        Style definition in the head tag
177. Given below is a window.open function: window.open(url,name,”attributes”)
How will you ensure that different URLs open in the same window?

a.         By keeping the second attribute name same
b.        By nullifying the name attribute
c.         By omitting the name attribute
d.        None of the above
178. How can you use a timer with a function called rearrange()?

a.         tmr=setTimeout(“rearrange()”,1)
b.        tmr=Timer(1,”rearrange()”)
c.         tmr=Timer(“rearrange()”,1)
d.        tmr=setTimeout(1,”rearrange()”)
179. Which of the following enables JavaScript Document Object Model to provide access to the HTTP header?
a.         document.GetHeader()
b.        document.getId(‘header’)
c.         document.getElementByName(‘header’)
d.        document.getElementById(‘header’)
e.         You cannot read the HTTP header information using JavaScript
180. The width of the h4 is defined as follow:
H4 {width:80%;}

How can you make the heading drop shadow?


a.         <h4 filter(shadowdrop)>Heading</h4>
b.        <h4 style=”filter:shadowdrop()”>Heading </h4>
c.         <h4 style=”filter:DropShadow()”>Heading </h4>
d.        <h4 style=”DropShadow ()”>Heading </h4>
e.         <h4 filter(dropshadow)>Heading</h4>
f.         <h4 style=”filter::shadowdrop()”>Heading </h4>
181. The anchor tag is defined as follows: <a href=”http://expertrating.com”>expertrating</a>
Which of the following styles will increase the spacing between letters on mouseover?

a.         a:hover { spacing: 1px;}
b.        a:hover { spacing: 2px;}
c.         a:hover { letter-spacing: 0;}
d.        a:hover { letter-spacing: 2px;}
182. What is the default value for z-index?
a.         -1
b.        1
c.         0
d.        null
e.         auto
183. Which of the following in-built functions is useful when you want to access a form element using its id?
a.         getItem(id)
b.        getFormElement(id)
c.         getElementById(id)
d.        All of the above
184. Which of the following properties is used to redirect a visitor to another page?
a.         document.URL
b.        window.location.href
c.         document.location.href
d.        link.href
e.         window.location
185. How would you change the image position from absolute to relative, if the image id is “ERImage”?
a.         document.getElementById(‘ERImage’).position=”relative”
b.        document.getElementById(‘ERImage’).setAttribute(“position”, “relative”)
c.         document.getElementById(‘ERImage’).style.position=”rel”
d.        document.getElementById(‘ERImage’).style.position=”relative”
186. Which of the following style properties is used to display only a part of an image?
a.         snap
b.        clip
c.         scroll
d.        visible
e.         overflow
f.         size
187. The width of H1 is defined as follows: H1 {width:100px;}
How can you make the heading flip horizontally?

a.         <h1 filter(flip)>Heading</h1>
b.        <h1 style=”filter::fliph()”>Heading</h1>
c.         <h1 style=”filter:fliph()”>Heading</h1>
d.        <h1 style=”FliphFilter()”>Heading</h1>
188. Which of the following statements with regard to CSS is correct?
a.         The positioning can be absolute, relative, or dynamic
b.        The float property for text/image can be left, right, or center
c.         The values for visibility can be true or false
d.        The display property sets how an element is displayed
189. You are collecting the user’s details on a webpage form. The id has to be repeated twice on the form, but you want the user to fill it once only. If the name of the first id is id1 and the second (to be auto filled) is id2, which code will you supply to the onkeyup event of id1?
a.         document.forms[0].id1.value=document.forms[0].id2.value
b.        document.forms[0].id2.value=document.forms[0].id1.value
c.         document.id1.value=document.id2.value
d.        document.id2.value=document.id1.value
190. You want to display an alert that contains a ‘ (single-quote) character. Which of the following characters would you use to escape the ‘ character?
a.         *
b.        \
c.         /
d.        _
e.         #
f.         %
g.         |
h.        ~
191. DHTML is a standard defined by the World Wide Web Consortium.
a.         True
b.        False
192. The following statements show two ways of calling a JavaScript function: i)onclick = “a()”
ii)onclick=”javascript:a()”
a() refers to a function written in JavaScript.
Which of the following statements is correct with regard to the above two statements?

a.         There is no difference between the two statements
b.        The first statement is incorrect and the second one is correct
193. Which of the following helps you make the text color change to green on moving the mouse over the text?
a.         a:hover {color: green;}
b.        a:visit {color: green;}
c.         a: active {color: green;}
d.        a:onmouseover {color: green;}
194. Is the following statement correct? The width of an element must be set for making filters work.

a.         Yes
b.        No
195. You want to move all the paragraphs 30px towards the right relative to their normal position. The style definition should be:
a.         p.relt{ position:relative; left:30px;}
b.        p.relt{ position:relative; left:-30px;}
c.         p{ position:relative; left:30px;}
d.        p{ position:relative; left:-30px;}
196. Which of the following will you use for changing the color of a button with id=btn, to green on a mouseover event?
a.         btn.color=”green”
b.        document.getElementById(‘btn’).color=”green”
c.         document.getElementById(‘btn’).style.color=”black”
d.        document.getElementById(‘btn’).style.color=”green”
197. Which of the following statements is incorrect with regard to a style sheet?
a.         Style sheet defines how an HTML element will be displayed
b.        Internal and external style sheets cannot be used together
c.         Multiple style definitions will cascade into one
d.        Same style sheets can be used by many HTML pages
198. Which of the following is not considered a part of DHTML?
a.         JavaScript
b.        CSS
c.         HTML
d.        VBScript
e.        All are part of DHTML
199. After clicking on a link, your main browser window spawns a small new window and writes some text on it. When both the window page sources are viewed, the small window page source seems identical to that of the large one. Which of the following makes this happen?
a.         The function writing to the new window did not close the document stream
b.        Windows receive the source code of the window that wrote to them
c.         Since the new window has no filename, it receives the source code of its parent
d.        None of the above
200. How would you randomly choose an element from an array named myStuff if the number of elements changes dynamically?
a.         randomElement = myStuff[Math.floor(Math.random() * myStuff.length)];
b.        randomElement = myStuff[Math.ceil(Math.random() * myStuff.length)];
c.         randomElement = myStuff[Math.random(myStuff.length)];
d.        randomElement = myStuff[Math.ceil(Math.random()*myStuff.length - 1)];
201. Which of the following will you use for changing the color of the textbox text with id=txtLocation to blue, on a mouseover event?
a.         txtLocation.color=”blue”
b.        document.getElementById(‘txtLocation’).color=”blue”
c.         document.getElementById(‘txtLocation’).style.color=”black”
            d.        document.getElementById(‘txtLocation’).style.color=”blue”

Question:
You want to disable the selection of text on the webpage. While trying to select some text, the user should see ‘not-allowed’ cursor. Which of the following helps you implement this by using JavaScript and IE 5+ browser?


a.         <body onSelectEnd=”this.style.cursor=’not-allowed’; return true;”
onMouseup=”this.style.cursor=’default’”>
b.        <body onMouseDown=”this.style.cursor=’default’”
onSelectEnd=”this.cursor=’not-allowed’; return false;”>
c.         <body onSelectStart=”this.style.cursor=’not-allowed’; return false;”
onMouseup=”this.style.cursor=’default’”>
d.        <body onMouseup=”this.style.cursor=’not-allowed’; return false;”
onSelectStart=”this.style.cursor=’default’”>

A DHTML page contains a table in between some text. You want to shift the table 20 pixels on the right to separate it from text. Which of the following styles would be suitable for the purpose?


a.         position:relative;
left:20PX;
b.        position:relative;
left:-20PX;
c.         position:relative;
right:-20PX;
d.        position:relative;

right:20PX;
Question:
Which of the following properties is used to redirect a visitor to another page?


a.         document.URL
b.        window.location.href
c.         document.location.href
d.        link.href

            e.         window.location
Question:
Which of the following statements is true with regard to setTimeout()?


a.         The statement(s) it executes run(s) only once
b.        It pauses the script in which it is called
c.         clearTimeout() does not stop its execution

            d.        It is required in every JavaScript function
Question:
What does the following code snippet do?

<input type=”radio” name=”r1″ value=”radio1″ onclick=”this.checked=false;alert(‘sorry’)”>


a.         The code is incorrect
b.        The code makes it necessary for the user to select the radio button
c.         The code disables the radio button

            d.        The code displays an alert when the user selects the button
Question:
You have two images of buttons, one bright and the other one dull. You want to change the dull image into a bright one. Which of the following attributes would you use with the img tag?


a.         onmousedown=”this.src=’bright.gif’”
onmouseup=”this.src=’dull.gif’”
b.        onmousedown=”bright.gif”
onmouseup=”dull.gif”
c.         onmouseup=”this.src=’bright.gif’”

 onmousedown=”this.src=’dull.gif’”
Question:
This is a JavaScript function for changing the color of the text box named “txtName”:

function SetColor(col)
{ document.forms[0].txtName.style.background=col }

How will you change the color of the text box txtName to green, only for the time that the user is pressing any key?


a.         <input type=”text” onkeydown=”SetColor(‘white’)” onkeyup=”SetColor(‘green’)” name=”txtName”>
b.        <input type=”text” onkeydown=”SetColor(‘green’)” onkeyup=”SetColor(‘white’)” name=”txtName”>
c.         <input type=”text” onkeydown=”SetColor(‘green’)” name=”txtName”>

            d.        <input type=”text” onkeydown=”SetColor(‘white’)” name=”txtName”>
Question:
What will the following code snippet do?

<form onreset=”alert(‘Please again fill the form’)”>


a.         It validates the contents of the form
b.        It prompts the user not to leave the fields of the form empty
c.         It prompts the user to fill the form once the form is cleared

            d.        None of the above
Question:
Which of the following can you use to accept user input?


a.         The prompt method
b.        The alert method
c.         A form field

            d.        The confirm method
Question:
You have embedded the document.write() method to write some text within a pair of <TD></TD> table tags. On loading the file, you get some garbled junk on the page that should contain the text. What makes this happen?


a.         The browser does not support JavaScript
b.        You are using an outdated version of the browser
c.         The browser does not support cookies

            d.        None of the above
Question:
Sliding menus can be made using DHTML?


a.         True

            b.        False
Question:
Which of the following helps you highlight some of the running text on a web page?


a.         <span style=”background-color:yellow”>
b.        <span style=”background-highlight:yellow”>
c.         <span style=”background:yellow”>

            d.        <span style=”highlight-color:yellow”>