title: Changing CSS class with JavaScript has no effect
body: <p>I want my nav bar (that is in the form of a list) to stay invisible (display: none;) on page load, and to appear when something is clicked (currently using a button)</p>
  
  <p>here is my HTML code:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html&gt;
  
  &lt;head&gt;
  &lt;script type="text/javascript" src="js/navbar.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="main.css"&gt;
  &lt;script type=text/javascript&gt;
  function changeClass(){
  document.getElementById("mainnav").setAttribute("class", "show");
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;div class="wrapper"&gt;
  
  &lt;input  type="button" value="click" onClick="changeClass()"&gt;
  
  &lt;div id="mainnav"&gt;
  
   &lt;ul &gt;
  &lt;li&gt;Home&lt;/li&gt;
  &lt;li&gt;Emergency Repair Service&lt;/li&gt;
  &lt;li&gt;Heating&lt;/li&gt;
  &lt;li&gt;Air Conditioning&lt;/li&gt;
  &lt;li&gt;Products&lt;/li&gt;
  &lt;li&gt;Specials&lt;/li&gt;
  &lt;li&gt;Contact&lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;/div&gt;&lt;!--mainnav--&gt;
  </code></pre>
  
  <p>Here is my CSS</p>
  
  <pre><code>#mainnav {
  display:none;
  }
  
  ul li {
  float: left;
  list-style-type: none;
  }
  
  .show {
  display: block;
  height: 75px;
  width: 100%;
  background-color: #000;
  }
  </code></pre>
  
  <p>Here is my javascript</p>
  
  <pre><code>function changeClass(){
  document.getElementById("mainnav").setAttribute("class", "show");
  }
  </code></pre>
  
  <p>thanks!</p>