A div element with class="example"
Another div element with class="example"

A p element with class="example"

Click the button to find out how many elements with class "example" there are in this document.

Note: The querySelectorAll() method is not supported in Internet Explorer 8 and earlier versions.