DOM tests - accessing elements

Back to index.

Spec: getElementById, getElementsByClassName (? is this the right one?), getElementsByTagName

getElementById

getElementsByClassName

getElementsByTagName

querySelector

Note: A browser that does not support certain CSS selectors is allowed to not support their querySelector(All) versions.

querySelectorAll

Test area

P with class="testClass" and id="testOne"

section with class="testTwo", in which are nested
Should not be here

Note: During the tests, the section with class="testClass second" and id="testFour" should be removed.

P with class="second testClass"

Again a P with id="testOne"

This paragraph has a class="weird:stuff"