What are best practices to be compatible with HTML DOM and XHTML DOM?
Though the intent is that HTML and XHTML can both produce identical DOMs, there still are some differences between working with an HTML DOM and an XHTML one. Case sensitivity : • Whenever possible, avoid testing Element.tagName, Node.nodeName, and Node.localName. Namespaces: • Use the namespace-aware version of Document.