title: How can I make alternate clicks change the background of a div within a button?
body: <p>I am trying to alternate the background colors of a div within a button using mouse clicks.</p>
  
  <p>I only managed to make it work on first click by adding <code>onclick="document.getElementById('nrOne').style.background = 'black'"</code>  to the 
  <code>&lt;button id="btn1"&gt;</code> element.</p>
  
  <pre><code>&lt;button id="btn1"&gt;
  
  &lt;div class="container-heading"&gt;
      &lt;div class="container-number" id="nrOne"&gt;
          &lt;h1&gt; 01 &lt;/h1&gt;
       &lt;/div&gt;
      &lt;div class="container-text"&gt;
          ...
      &lt;/div&gt;
  </code></pre>
  
  <p>Any help or tips is highly appreciated. Thank you StackOverflow!</p>