P element with class="child" in first div with class="example". P's index is 0, and Div's index is 0.
First P element with class="child" and "color" in second div with class="example". P's index is 0, and Div's index is 1.
Second P element with class="child" and "color" in second div with class="example". P's index is 1, and Div's index is 1.
First P element with class="child" and "color" in third div with class="example". P's index is 0, and Div's index is 2.
Second P element with class="child" and "color" in third div with class="example". P's index is 1, and Div's index is 2.
Click the button to change the background color of the first p element with classes "child" and "color" inside the second div element with class="example".
Note: The getElementsByClassName() method is not supported in Internet Explorer 8 and earlier versions.