The behaviour of the document elements in XML can be defined by
2014
The behaviour of the document elements in XML can be defined by
- A.
Using document object
- B.
Registering appropriate event handlers
- C.
Using element object
- D.
All of the above
Attempted by 162 students.
Show answer & explanation
Correct answer: D
Answer: All of the above — the behaviour of document elements in XML can be defined using the document object, the element object, and by registering appropriate event handlers.
Using the document object: The document represents the entire XML/DOM tree, so it provides global access to nodes, supports querying and modification of elements, and enables patterns like event delegation for managing behaviour at a higher level.
Using the element object: Individual element objects expose properties and methods to change content, attributes, or state for specific nodes, allowing you to define behaviour that applies to particular elements.
Registering appropriate event handlers: Event handlers respond to user or programmatic events and are the mechanism that triggers behaviour. Handlers can be attached to specific elements or to the document (for delegation) to implement interactive behaviour.
Because each approach addresses a different aspect (global access, element-specific control, and event-driven triggers), the complete and practical way to define element behaviour is to use all three together.