Question: I am working with DOM methods right now and my console says there are no errors but in the browser none of my methods are

I am working with DOM methods right now and my console says there are no errors but in the browser none of my methods are working. I am unsure if I have an undetected error somewhere. This is my code for 3 different examples:

1. Change 1 style of the container div:

container = document.getElementById("container");

container.style.background = "a03faa";

2. Loop through an array and change the background colour for each paragraph:

paragraphs = document.getElementsByTagName("p");

for(let i=0; i

3. Grab

  • tags of the
      tag and apply a style to each one of them:

      liItems = document.getElementsByTagName("li");

      for(let i=0; i

  • Step by Step Solution

    There are 3 Steps involved in it

    1 Expert Approved Answer
    Step: 1 Unlock blur-text-image
    Question Has Been Solved by an Expert!

    Get step-by-step solutions from verified subject matter experts

    Step: 2 Unlock
    Step: 3 Unlock

    Students Have Also Explored These Related Databases Questions!