Hide browser and version differences by creating a set of objects that expose a common set of methods, and that are accessed by the DHTML application.
Navigator 4.x and up (including Mozilla), and IE 4.x and up support DHTML and support the creation of scripting objects. These browsers and their versions also support accessing page elements as objects, and the ability to wrap these page elements within the scripting objects.
Scripting objects can be defined to include any number of methods, and the exposed methods point to impelementation specific methods.
The method implementations then provide the browser/version specific processing.
When creating cross-browser/cross-version DHTML objects, provide a common set of interfaces that are accessed by the application, but which are implemented differently, internally.
The application sets or gets a property using the interface methods, and the browser-specific implementation takes care of the browser-specific processing transparent to the DHTML application developer.
Accessing the page elements via the exposed object model (or models), and modifying element properties is not the only area where browser implementations differ.
Event handling is also different between the browser versions.
For instance, event capturing within an individual element is exposed in IE 4.x, more so in IE 5.x, as well as Mozilla (Navigator 5.x). However, event capturing is limited with Navigator 4.x, and is either not supported for elements, or only supported through direct event capturing.