title: Setting variable names in jQuery from a variable
body: <p>I'm using multiple select boxes on my website and use the <code>id</code> from each of these to select the <code>:selected</code> val and set it as a variable. You will see the 3 randomly chosen below and I'm stuck on adding the word val into the new way of setting multiple variables.</p>
  
  <p><strong>before</strong></p>
  
  <pre><code>var maptypecontrolval       = $('#maptypecontrol&gt;option:selected').val();
  var pancontrolval       = $('#pancontrol&gt;option:selected').val();
  var clickzoomcontrolval     = $('#clickzoomcontrol&gt;option:selected').val();
  </code></pre>
  
  <p><strong>after</strong></p>
  
  <pre><code>$(".settings select").each(function(){
      var id = $(this).attr('id');
      console.log(id);
  });
  </code></pre>