title: Javascript change color on click and keep the same color
body: <p>I have currently the following code:</p>
  
  <pre><code>&lt;li&gt;&lt;a href="index.php" id="1" onclick="document.getElementById('1').style.background = '#8B4513';"&gt;Weblog&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>This changes the color, but because it opens index.php the color won't stay at the same color. It returns to the original color.</p>
  
  <p>How can i keep it the same color, in a different page?</p>
  
  <p>Thanks</p>