Using document.getElementsByTagName

Objective

  • Use document.getElementsByTagName

Example of using document.getElementsByTagName

Clicking on the button below should change the color of the text and background of all the "div" elements on the page.
Code: