1. The word “document” mainly refers to ______________
a) Dynamic Information
b) Static Information
c) Both Dynamic and Static Information
d) Temporary information
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.
3. Which identifier is used to represent a web browser window or frame?
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.
4. Which property in the Window object is used to refer to a Location object?
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.
5. Which Window object method is used to display a message in a dialog box?
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().
6. 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
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.
7. Which of the following is a global object?
8. 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
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.
9. Which is the property that represents the content displayed in the window?
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.
10. How to pick a document element based on the value of its id attribute?
c) both getElementsbyId() and getElementbyId()
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.
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!