Dom And Event Handling(Engineering > Computer Science And Engineering > Javascript ) Questions and Answers

Question 1. Which is the most appropriate database for developers requiring huge amount of data?
  1.    Database
  2.    Datawarehouse
  3.    Web databases
  4.    Access
Explanation:-
Answer: Option C. -> Web databases


Developers who need to work with really huge amounts of data like to use databases, and the most recent browsers have started to integrate client-side database functionality into their browsers.



Question 2. Which of the following defines the Cookie visibility?
  1.    Document Path
  2.    localStorage
  3.    sessionStorage
  4.    All of the mentioned
Explanation:-
Answer: Option D. -> All of the mentioned


Cookie visibility is scoped by document origin as localStorage and sessionStorage are, and also by document path.



Question 3. A new web browser window can be opened using which method of the Window object ?
  1.    createtab()
  2.    Window.open()
  3.    open()
  4.    All of the mentioned
Explanation:-
Answer: Option B. -> Window.open()


You can open a new web browser window with the open() method of the Window object. Window.open() loads a specified URL into a new or existing window and returns the Window object that represents that window.



Question 4. Which of the following property specifies the string of text that was entered?
  1.    message
  2.    data
  3.    string
  4.    text
Explanation:-
Answer: Option B. -> data


A textinput event handler has a data property that specifies the string of text that was entered.



Question 5. What is the datatype of the go() method's parameter?
  1.    String
  2.    Integer
  3.    Double
  4.    Float
Explanation:-
Answer: Option B. -> Integer


The go() method takes an integer argument and can skip any number of pages forward and backward in the history list.



Question 6. The process by which the browser decides which objects to trigger event handlers on is
  1.    Event Triggering
  2.    Event Listening
  3.    Event Handling
  4.    Event propogation
Explanation:-
Answer: Option D. -> Event propogation


Event propagation is the process by which the browser decides which objects to trigger event handlers on.



Question 7. What is the property textContent?
  1.    Sets the textual content of a node
  2.    Returns the textual content of a node
  3.    Both a and b
  4.    None of the mentioned
Explanation:-
Answer: Option C. -> Both a and b


The property textContent sets or returns the textual content of a node and its descendants.



Question 8. Which of the following Node types have a node value equal to null?
  1.    Document
  2.    DocumentFragment
  3.    DocumentType
  4.    All of the mentioned
Explanation:-
Answer: Option D. -> All of the mentioned


All the three node types namely, Document, DocumentFragment, DocumentType have a node value equal to null.



Question 9. Which of the following key property holds the key name as a string?
  1.    keyName
  2.    key
  3.    keyName(string)
  4.    Nameofkey(string)
Explanation:-
Answer: Option B. -> key


The DOM Level 3 Events defines a new key property that contains the key name as a string.



Question 10. The events that represents occurrences related to the browser window are
  1.    Window
  2.    Element
  3.    Display
  4.    Handlers
Explanation:-
Answer: Option A. -> Window


Window events represent occurrences related to the browser window itself, rather than any specific document content displayed inside the window.