1016). Which of the following can be implemented using animation?
[A]Fireworks
[B] Fade Effect
[C]Roll-in or Roll-out
[D]All of the mentioned
Show Answer
Correct Answer: All of the mentioned
Notes:
Answer: d
Explanation: JavaScript animations are done by programming gradual changes in an element’s style. You can use JavaScript to create a complex animation which includes but not limited to:
Fireworks
Fade Effect
Roll-in or Roll-out
Page-in or Page-out
Object movements.
1017). Which is the function that calls another function after a time interval?
[A]setTimeout()
[B]setTime()
[C]callafter()
[D]timeSet()
Show Answer
Correct Answer: setTimeout()
Notes:
Answer: a
Explanation: The setTimeout(function, duration) calls function after duration milliseconds from now. setInterval(function, milliseconds) is same as setTimeout(), but repeats the execution of the function continuously.
1018). Which function is used to clear the timer value?
[A]clearTimervalue()
[B]clearTimeout()
[C]clear()
[D]flush(timer)
Show Answer
Correct Answer: clearTimeout()
Notes:
Answer: b
Explanation: The clearTimeout() method clears a timer set with the setTimeout() method. The ID value returned by setTimeout() is used as the parameter for the clearTimeout() method.
1019). Which is the property used to position the object in the left of the screen?
[A]object.position = left
[B] object = position.left
[C]object.style.left
[D]object.shiftleft
Show Answer
Correct Answer: object.style.left
Notes:
Answer: c
Explanation: The property object.style.left = distance in pixels or points sets distance from left edge of the screen. This property specifies the left position of the element including padding, scrollbar, border and margin. Whereas the setTimeout(function, duration) calls function after duration milliseconds from now.
1020). Which is the function used to call a function in every time duration?
[A]callafter()
[B]setInterval()
[C] setTimeout()
[D]setTime()
Show Answer
Correct Answer: setInterval()
Notes:
Answer: b
Explanation: The setInterval(function, duration) calls function after every duration milliseconds.
1021). How do we get the DOM object in JavaScript?
[A]getElementbyId()
[B] getObject()
[C]getElement()
[D] getNodeobject()
Show Answer
Correct Answer: getElementbyId()
Notes:
Answer: a
Explanation: The getElementbyId() is used to get the DOM object in JavaScript by simply calling that function associated with the HTML document. The object in this method gets referenced by the id name.
1022). How to assign the image source in JavaScript?
[A]image = “url”
[B] source(“url”)
[C]image.src = “url”
[D]img.src=”url”
Show Answer
Correct Answer: image.src = “url”
Notes:
Answer: c
Explanation: For accesing any image in webpage its address or url is specified. The image source is defined as image.src = “/images/html.gif”.
1023). How do we create and preload an image object in JavaScript?
[A]Use new keyword
[B]Call Image()
[C]Both Use new keyword and Call Image()
[D]Set image()
Show Answer
Correct Answer: Both Use new keyword and Call Image()
Notes:
Answer: c
Explanation: The Image() constructor creates and preloads a new image object. The url is specified and the image is preloaded.
1024). Which event handler is triggered when the user’s mouse moves onto a link?
[A]onMouseOver
[B]onMouseOut
[C]onMouse
[D]onMouseOnto
Show Answer
Correct Answer: onMouseOver
Notes:
Answer: a
Explanation: The onmouseover attribute fires when the mouse pointer moves over an element. The onmouseover attribute is often used together with the onmouseout attribute.