326). The word “document” mainly refers to ______________
[A] Dynamic Information
[B] Static Information
[C]Both Dynamic and Static Information
[D] Temporary information
Show Answer
Correct Answer: Static Information
Notes:
Answer: b
Explanation: Some pages present static information and can be called documents. The document is a keyword which is used in selecting any particular element in the document.
327). Which object is the main entry point to all client-side JavaScript features and APIs?
[A]Standard
[B]Location
[C]Window
[D]Position
Show Answer
Correct Answer: Window
Notes:
Answer: c
Explanation: The Window object is the main entry point to all client-side JavaScript features and APIs. It represents a web browser window or frame, and you can refer to it with the identifier window.
328). Which identifier is used to represent a web browser window or frame?
[A]frames
[B]window
[C]location
[D]frame
Show Answer
Correct Answer: window
Notes:
Answer: b
Explanation: The window object represents a web browser window or frame, and you can refer to it with the identifier window. Global variables are properties of the window object and Global functions are methods of the window object.
329). Which property in the Window object is used to refer to a Location object?
[A]position
[B]area
[C]window
[D]location
Show Answer
Correct Answer: location
Notes:
Answer: d
Explanation: The Window object defines properties like location, which refers to a Location object that specifies the URL currently displayed in the window and allows a script to load a new URL into the window. The window.location object can be used to get the current page address (URL) and to redirect the browser to a new page.
330). Which Window object method is used to display a message in a dialog box?
[A]alert()
[B]prompt()
[C]message()
[D]console.log
Show Answer
Correct Answer: alert()
Notes:
Answer: a
Explanation: The Window object defines methods like alert(), which displays a message in a dialog box. A prompt message can be displayed on the screen using alert().
331). The setTimeout() method is used to _______________
[A] Make the event sleep
[B]Register a function to be invoked after a certain time
[C] Invoke an event after a certain time
[D]Time for iteration
Show Answer
Correct Answer: Register a function to be invoked after a certain time
Notes:
Answer: b
Explanation: The setTimeout(), which registers a function to be invoked after a specified amount of time. The setTimeout() method calls a function or evaluates an expression after a specified number of milliseconds.
332). Which of the following is a global object?
[A]Register
[B]Location
[C]Window
[D]Position
Show Answer
Correct Answer: Window
Notes:
Answer: c
Explanation: In client-side JavaScript, the Window object is also the global object. This means that the Window object is at the top of the scope chain and that its properties and methods are effectively global variables and global functions.
333). When will the window property come into play?
[A] Representation convenience
[B]Use as an extension of other objects
[C]Use objects in the Window object
[D] Refer to window object itself
Show Answer
Correct Answer: Refer to window object itself
Notes:
Answer: d
Explanation: The Window object has a property named window that always refers to itself. You can use this property if you need to refer to the window object itself.
334). Which is the property that represents the content displayed in the window?
[A]document
[B]content
[C]window
[D]frame
Show Answer
Correct Answer: document
Notes:
Answer: a
Explanation: One of the most important properties of the Window object is document: it refers to a Document object that represents the content displayed in the window.
335). How to pick a document element based on the value of its id attribute?
[A]getElementsbyId()
[B]getElementbyId()
[C]both getElementsbyId() and getElementbyId()
[D]getElement
Show Answer
Correct Answer: getElementbyId()
Notes:
Answer: b
Explanation: The Document object has important methods such as getElementById(), which returns a single document element (representing an open/close pair of HTML tags and all of the content between them) based on the value of its id attribute. Using this property different operation can be performed on the selected element.