Is there an agreed set of \"best practices\" for use of the DOM Level 0 collections in modern JavaScript applications? (document.forms
, document.images
In jQuery-using applications, I've noticed a tendency to, say, change the contents of a drop-down using $(...).html() to switch out the underlying nodes, rather than using element.options[]. Is this because the dom0 collections are best avoided, or because jQuery makes it much easier to change the underlying DOM structure?
That can be explained quite easily. 95% of jQuery developers are ignorant of the fact the DOM API exists or can be used.
The fact that jQuery is abused for things the DOM can do more easily is simply caused by people not learning the DOM.
Personally I'd say use DOM 0, but then again, personally I would say use a DOM shim and don't use jQuery. It's all a matter of choice.
Do whatever is the most maintainable