title: if we're at default and no other options were chosen, do nothing. if were back at default from other options, do something
body: <p>I have a default value of 2 <code>var items = [2]</code> and click events that changes the value from 2 to 3 back and forth depending on the click. since the default value is 2, when the user clicks on the 2 option in the li nothing should happen(that's what i want) because no changes need to be made. only if the user clicked  any other option, they will be able to click the 2 option to use the 2 functionality (well they will be able to click it but no functionality will occur). I guess I need help with logic</p>
  
  <pre><code>      $(document).ready( function(){
          var items = [2]
          $('ul  &gt; li &gt; span').on('click', function(e){
  
              if($(this).siblings("ul").is(":visible")){
                  $(this).siblings("ul").slideUp("fast")
              }else{
                  $(this).siblings("ul").slideDown("fast")
              }
  
          })
          $('ul.adding li ul li').on("click" , function(e){
              if($(e.target).hasClass('twoItems')){
                  if(items[0] !== 2){
                      //this is messed up
                      items[0] = 2
                      $('.output').append(items[0])
                  }else{
                      $('.output').append(items[0])
                  }
  
              }
              if($(e.target).hasClass('threeItems')){
                  items[0] = 3
                  $('.output').append(items[0])
              }
              console.log(items)
  
          })
          $('.output').append(items[0])
  
  
      });
  </code></pre>
  
  <p>html:</p>
  
  <pre><code>&lt;div class="container"&gt;
      &lt;ul class = "adding"&gt;
          &lt;li&gt;&lt;span class = "span"&gt;Add&lt;/span&gt; &lt;ul&gt;
              &lt;li class="twoItems"&gt;Two Item&lt;/li&gt;
              &lt;li class = "threeItems"&gt;three items&lt;/li&gt;
          &lt;/ul&gt;&lt;/li&gt;
  
      &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;div class="output"&gt;&lt;/div&gt;
  </code></pre>