What is the difference between a DOM model based on an HTML document and a DOM model based on an XML document from a jQuery point of view? Are there any fundamental differences or does everything work identically?

  • Just someone claims that the DOM model of HTML and XML (SVG) are absolutely identical, someone claims the opposite ... What do you think about this issue? - spoilt
  • 2
    html allows single tags vila <br> while in xml they must be of type <br/>. This is a practical difference, but as for the standard one should look. But from the point of view of jQuery, I think it’s one-handed. - Chad

2 answers 2

There are no differences. Is that in the case of HTML jquery provides pseudo properties and methods, such as for example. Val () returns the value of a form element.

To work with XML, let's say from a variable just write

$(xml).find(selector) 

Well, then work on health

    DOM is an object model for document presentation. HTML, XML, RSS, etc. - these are different languages ​​that can be used to represent a document. DOM (document model), created on the basis of different languages, is distinguished by the set of objects used. jQuery is sharpened by the use of DOM based on HTML, for it excellent objects or properties of objects used outside of HTML may be (and most likely will be) incomprehensible.