title: Fire event depending on click event on data attribute
body: <p>I have 3 tabs with the same data-attribute but its value changes.</p>
  
  <pre><code>&lt;li&gt;
      &lt;a href="#tab1"
         data-set="set1"&gt;{{{text}}}&lt;/a&gt;
  &lt;/li&gt;
  
  &lt;li&gt;
      &lt;a href="#tab2"
         data-set="set2"&gt;{{{text}}}&lt;/a&gt;
  &lt;/li&gt;
  
  &lt;li&gt;
      &lt;a href="#tab3"
         data-set="set3"&gt;{{{text}}}&lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>Depending on which of those elements you clicked on, another element has to change its background.</p>
  
  <p>So:</p>
  
  <pre><code>$('a[data-set="DYNAMIC SET"]').on('click', function(e) {        
      $('.eight-box').css({background: '/path/image'});        
  });
  </code></pre>
  
  <p>What can I do to make it dynamic and not only use if-else or switch-case?</p>
  
  <p>Lets say: <code>set1</code> sets one background. <code>set2</code> sets another background and so on. So the path to the image will change too.</p>