title: Concatenating a variable as the jQuery val() argument?
body: <p>I'm trying to set the value attribute of an input (a hidden input in a form) using the jQuery val() function. My idea was to concatenate the name of the variable and pass it as the argument to the function, but it doesn't work as I expected. The code in question is in the very last line:</p>
  
  <pre><code>$(document).ready(function(){
  
      var hash =  document.location.hash;
      var turismosSid = "1c0f8e3ec28b09f9487140930a0c0b73";
      var comercialesSid = "b31150acd348f775785b7c4a7398a3c6";
  
      if (hash === "#turismos") {
        activaTab("turismos");
        $('#js-sid').val(turismosSid);
      } else {
          activaTab("comerciales");
          $('#js-sid').val(comercialesSid);
      }
  
      $('#js-turismos-btn').on('click', function(){
          activaTab("turismos");
          document.location.hash = "turismos";
      });
  
      $('#js-comerciales-btn').on('click', function(){
          activaTab("comerciales");
          document.location.hash = "comerciales";
      });
  
  
      function activaTab(cual){
          $('#js-turismos-btn').addClass('bg-faded');
          $('#js-turismos').hide();
          $('#js-comerciales-btn').addClass('bg-faded');
          $('#js-comerciales').hide();
  
          $('#js-'+ cual + '-btn').removeClass('bg-faded');       
          $('#js-'+ cual).fadeIn(300);
  
          $('#js-sid').val(cual + "Sid");
      }
  
  });
  </code></pre>
  
  <p>Rather than set the input's value to either of the variables turismosSid or comercialesSid, the function sets the value as the STRING turismosSid or comercialesSid. What am I doing wrong?</p>