title: add variables to a JavaScript event call?
body: <p>I am wondering if it is possible to do something like so:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id="myspace" class="thing"&gt;&lt;/div&gt;
  &lt;div id="mytable" class="thing"&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>document.getElementById('my'+this).on('click', function(){
       document.getElementById(this).innerHTML = 'Chosen';
  });
  </code></pre>
  
  <p>The logic is that there are two boxes, first being <code>myspace</code>, second being <code>mytable</code>. Upon clicking one of either, the box's innerHTML will read <code>"Chosen"</code>. </p>
  
  <p>Basically, I would like to see if I can avoid having to write multiple click events and/or if statements. </p>
  
  <p>JSFiddle 
  <a href="https://jsfiddle.net/7cLu9uah/" rel="nofollow">https://jsfiddle.net/7cLu9uah/</a></p>