title: Change a color of a text line when clicked with JS
body: <p>I am new into JavaScript and I've been trying to change the color of a text line in my website when I click on it with JS, I know there are ways to do it just with CSS but I'd like to practice some JS, this is what I've been trying so far:</p>
  <p>I have this list:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function white() {
    const input = document.getElementById("weekly");
    input.style.color = "white";
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ul&gt;
    &lt;li&gt;&lt;a id="weekly" href="/index.html" onclick="white()"&gt;Weekly&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><em>It is a longer list but i didn't want this to look messy :)</em></p>
  <p>I want to change the color of &quot;Weekly&quot; when it's clicked on and this is what i have tried:
  I've been trying for a while and this is the best I came up with but doesn't seem to work.</p>