title: How do I call a created function for multiple elements at once?
body: <p>I created a brief function just to illustrate my point.</p>
  
  <p>Suppose I have created an <code>myFunction()</code> function that does the following service:</p>
  
  <pre><code>function myFunction(element,property,color){
      $(element).css(property,color);
  };
  </code></pre>
  
  <p>Then for each element that I want to apply this function I will use:</p>
  
  <pre><code>myFunction('div','background-color','green');
  myFunction('span','border-color','blue');
  myFunction('i','color','red');
  </code></pre>
  
  <p>A demo:</p>
  
  <p><a href="http://jsfiddle.net/h4yY3/" rel="nofollow">http://jsfiddle.net/h4yY3/</a></p>
  
  <p>But I wish i could call the function only once for all these handlers. For example, I could do something like:</p>
  
  <pre><code>function myFunction({element,property,color}){
  ...
  }
  
  myFunction({'div','background-color','green'},{'span','border-color','blue'},{'i','color','red'});
  </code></pre>
  
  <p>Could someone please teach me the correct way to do this? I tried a search but do not know if I'm using the correct terms to refer to this as 'handler'.</p>
  
  <p>Please, suggest.
  Thank you.</p>