Home

Awesome

DOM4

build status donate

A fully tested and covered polyfill for new DOM Level 4 entries

Via cdnJS

Many thanks to cdnjs for hosting this script. Following an example on how to include it.

<script
  src="//cdnjs.cloudflare.com/ajax/libs/dom4/2.0.0/dom4.js"
>/* DOM4 */</script>

New v2

Both query and queryAll have been removed, while CSS :scope selector has been added.

Features

This is a fully tested and covered polyfill for both new DOM Level 4 parentNode entries:

And for new DOM Level 4 childNode entries:

The implemented test is conform to current specifications.

Other fixes/standardized behaviors include:

If you need other polyfills too, have a look at another DOM-shim repo.

Compatibility

Theoretically compatible with all browsers you know that are truly used these days, here a list:

It's way easier if you tell me which browser in a current relevant market share is not supported :-)

For IE8 only it's recommended to include ie8 script before dom4 or CustomEvent, addEventListener, and dispatchEvent won't work as expected.

Which File

The minified version is here, while the max one here. If you want to test directly try this page, it should be green.

Want to contribute?

If you found a bug, want to contribute or have any questions feel free to fill an issue or pull request, and help us to improve the Dom4

License

Dom4 Code released under the MIT license.