Can I somehow load a "broken" DOM tree in JavaScript
for example if someone forget to close a tag..
Can I somehow load a "broken" DOM tree in JavaScript
for example if someone forget to close a tag..
The current page? ...if this is an HTML document (ie. not served as XHTML) then the browser will auto-close (and even attempt to 'fix') certain elements that may at first appear 'broken'. When reading the current DOM, you are reading the fixed version. However, if the page is in fact 'broken' (or is just not standards compliant) then different browsers will 'fix' it differently. Depending on how broken is "broken", this may or may not be OK. If you are wanting this to work cross-browser, then this is probably not OK.