The Element Interface
The Element interface is perhaps the most important of all the DOM component interfaces. After all, it's possible to write XML documents without any comments, processing instructions, attributes, CDATA sections, entity references, or even text nodes. By contrast, every XML document has at least one element, and most XML documents have many more. Elements, more than any other component, define the structure of an XML document.
Example 11.1 summarizes the Element interface. This interface includes methods to get the prefixed name of the element, manipulate the attributes on the element, and select from the element's descendants. Of course, Element objects also have all the methods of the Node superinterface, such as appendChild() ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access