title: Displaying list as collapsed
body: <p>I have created a list and want to display it as collapsed and after clicking on a list item it should be expanded. I have created demo <a href="http://jsfiddle.net/UDKLK/2/" rel="nofollow">here</a>.
  I am using following javascript method:</p>
  
  <pre><code>function toggle(id){
      var e = document.getElementById(id);
      if (e.style.display == '') {
          e.style.display = 'none'; 
      } else {
          e.style.display = '';
      }
  }
  </code></pre>
  
  <p>I have the following issues:</p>
  
  <ol>
  <li>With this code Expand/Collapse is not happening in jsFiddle where as same code is working properly in html.</li>
  <li>By default list should be displayed as collapsed.</li>
  </ol>
  
  <p>Any thoughts?</p>