title: jQuery: Storing a Div name in a variable, then calling it in an action
body: <p>So i've been trying to wrap my head around this, all i'm trying to do is store a div name in a variable for easy editing, then allow it to be called in standard actions such as show/hide.</p>
  
  <p>Without the variables, my code works fine but with them it will not load the div, i've done a console log to make sure it knows what the div name is based off the stored variable and it returns correctly.</p>
  
  <p>Here is my code:- </p>
  
  <pre><code>var buttonActive = 0;
  var yourMenuDiv = '.menu-menu-1-container';
  
  $(function() {
  
      $(yourMenuDiv).before('&lt;div class="responsiveButton"&gt;&lt;div id="rBBar"&gt;&lt;/div&gt;&lt;div id="rBBar"&gt;&lt;/div&gt;&lt;div id="rBBar"&gt;&lt;/div&gt;&lt;/div&gt;');
      $(yourMenuDiv).before('&lt;div class="responsiveMenu"&gt;&lt;div id="responsiveTitle"&gt;&lt;/div&gt;&lt;/div&gt;');
      $(yourMenuDiv + 'ul').clone().appendTo('.responsiveMenu');
      $('.home #logoImage').clone().appendTo('#responsiveTitle');
  
      console.log(yourMenuDiv);
  
      $(window).resize(function() {
          if ($(window).width() &lt; 600) {
              $(yourMenuDiv).hide();
              $('.responsiveMenu, .responsiveButton').show();
          }else{
              $('.responsiveMenu').removeClass('expandMenu');
              $('.responsiveButton').removeClass('expandMenuButton');
              $('.responsiveMenu, .responsiveButton').hide();
              $(yourMenuDiv).show();
              buttonActive = 0;
          }
      });
  
      $(function() {
          if ($(window).width() &lt; 600) {
              $(yourMenuDiv).hide();
              $('.responsiveMenu, .responsiveButton').show();
          }else{
              $('.responsiveMenu, .responsiveButton').hide();
              $(yourMenuDiv).show();
              buttonActive = 0;
          }
      });  
  
      $('.responsiveButton').click(function() {
          if (buttonActive == 0){
              $('.responsiveMenu').addClass('expandMenu');
              $('.responsiveButton').addClass('expandMenuButton');
              buttonActive = 1;
          }else{
              $('.responsiveMenu').removeClass('expandMenu');
              $('.responsiveButton').removeClass('expandMenuButton');
              buttonActive = 0;
          }
      });
  
  });
  </code></pre>
  
  <p>Thank you</p>