title: JavaScript to make div visible after click
body: <p>I currently have a button that I would like open a hidden div box that will then show a list to open a second div box. The code does not seem to be working for the JavaScript.</p>
  
  <p>Here is the JavaScript:</p>
  
  <pre><code>$('#content1 div').each(function(i){
  $(this).addClass('level1');
  });
  $('#content2 div').each(function(i){
      $(this).addClass('level2');
  });
  
  $('#menu2 a').click(function (e) {
      $('#content1 div.makeVisible').removeClass('makeVisible');
      $(divToMakeVisible).addClass('makeVisible');
      e.preventDefault();
  });
  $('div.level1 a').click(function (e) {
      $('#content1 div.level1').removeClass('makeVisible');
      divToMakeVisible = $(this).attr('href');
      console.log(divToMakeVisible);
      $(divToMakeVisible).addClass('makeVisible');
      e.preventDefault();
  });
  $('div.level2 a').click(function (e) {
      $('#content2 div.level2').removeClass('makeVisible');
      divToMakeVisible = $(this).attr('href');
      $(divToMakeVisible).addClass('makeVisible');
      e.preventDefault();
  });
  </code></pre>
  
  <p>The full code on JSFiddle can be found here: <a href="http://jsfiddle.net/nkxsP/20/" rel="nofollow">http://jsfiddle.net/nkxsP/20/</a></p>