Here are some tips for working with Javascript: Utilize 3rd party libraries that address compatibility issues. For example:
jQuery: handles browser-specific event details and resolves various other issues
JSON2: provides a solution for missing JSON definitions in certain browsers
html5shim: offers support for HTML5 in specific browsers
raphael: addresses SVG/VML inconsistencies with a consistent API (useful for IE8 and older versions)
When it comes to CSS and HTML compatibility: it largely depends on whether you need to support versions of IE before 9. IE9 has resolved many of the compatibility issues.