title: How to add a conditional statement (Using an element ID as condition) to Javascript?
body: <p>Again, I have another basic question for the wonderful users here at StackOverflow. I am new to client-side programming and although this is a fairly basic example in other languages I know, I am unsure of the proper syntax of doing so here (if it has been implemented).</p>
  
  <p>Here is my current code. The page, for reference, can be found at <a href="http://paysonfirstassembly.com/" rel="nofollow">http://paysonfirstassembly.com/</a>. However, I have not uploaded the most recent version and the function below does not exist on the production server (yet).</p>
  
  <pre><code>$(function () {
      var $subnavContainer = $(".subwrapperBlue");
      $(".navElements").click(function () {
          $subnavContainer.show("slow");
      });
  </code></pre>
  
  <p>This is my most recently updated code. The div will not reappear after clicking, however, the alert box DOES pop up.</p>
  
  <pre><code>var $subnavContainer = $(".subwrapperBlue");
  $(function () {
      $(".navElements").click(function () {
          switch ($(this).index()) {
              case 0:
                  $subnavContainer.html("some html");
                  break;
              case 1:
                  $subnavContainer.html("some more html");
                  break;
              case 2:
                  $subnavContainer.html("some other html");
                  break;
              case 3:
                  $subnavContainer.html("the final html");
                  break;
          }
          $subnavContainer.show("slow");
          alert("this works");
      });
  </code></pre>