title: JavaScript SetTimeout to change background color
body: <p>I am trying (and failing) to use javascript to change the background color and opacity of elements of a webpage I am building. This is the code I have in my javascript file.</p>
  
  <pre><code>setTimeout(function background() {
      document.body.style.backgroundColor = "#000";
  },1000);
  </code></pre>
  
  <p>I am unsure why this isn't working and it would be amazing if someone could help. Also I have no idea how I would make this function change the opacity of images from 0 to 1 and from 1 to 0 after 1 second. If anyone could lend a hand that would be amazing.</p>
  
  <p>Thanks! </p>