title: Change Color onClick
body: <p>I am trying to change the color of an element using <code>.style.color</code> and it isn't going very smoothly. My goal is for it to change red and then blue on clicks. Any recommendations?</p>
  
  <pre><code>var turns = 0;
  
  function dot_01() {
      if (turns === 0) {
          turns++;
          document.getElementById("dot_01").style.color = 'red';
       } else if (turns === 1) {
          turns--;
          document.getElementById("dot_01").style.color = 'blue';
      }
  }
  
  &lt;div class="dot" id="dot_01" onclick="dot_01()"&gt;&lt;/div&gt;
  </code></pre>