title: Change boolean var onClick based on parameter
body: <p>I am creating a page that sets a variable to true or false based on a button click. This is doable if I create a function per variable/button, but since there will be quite a few variables in the end, I would like to do this in a single function, if possible:</p>
  
  <pre><code>&lt;div&gt;
    &lt;button type="button" id="colorbutton" class="button red" onClick="manualSelect('Color')"&gt;Colors&lt;/button&gt;
    &lt;button type="button" id="animalbutton" class="button red" onClick="manualSelect('Animal')"&gt;Animals&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>$manualColor = false;
  $manualAnimal = false;    
  
  function manualSelect(item) {
    if ($('manual' + item) == false) {
      $('manual' + item) = true;
    } else {
      $('manual' + item) = false;
    }
  }
  </code></pre>
  
  <p>I know this is stupid, it's just to set the example.</p>
  
  <p>Here's the full script:
  <a href="https://jsfiddle.net/8ers54s9/5/" rel="nofollow noreferrer">https://jsfiddle.net/8ers54s9/5/</a></p>