Here is 2 different script, one target an element's CSS property and the other its style.
A heading with class="example"
A paragraph with class="example".
Click the button to add a background color to the first element in the document with class="example" (index 0).
Note: The querySelectorAll() method is not supported in Internet Explorer 8 and earlier versions.