The document object model (DOM) is not a particularly pleasant API to program against.
A perhaps less appreciated reason is that the DOM is a low-level API
that exposes only basic capabilities. By design, low-level APIs avoid making
too many assumptions about how developers might want to use the underlying
objects. Certain popular DOM extensions such as
querySelector could be considered more mid-level, as they
evolved based on what developers were actually doing.
Correct for bugs and implementation differences in specific browsers. YUI accomplishes this using feature detection (testing for the existence of a feature) and capability detection (verifying whether ...