YUI's DOM methods have the ability to accept an array of elements for manipulation, with the addStyle() method being one of them. This means you can do something like:
YAHOO.util.Dom.setStyle(['el1', 'el2'], 'color', 'red');
However, keep in mind that this method may only work with element ids. So make sure your first element has an id of el1 and so on.
UPDATE:
If you prefer using the YAHOO.util.Selector
module, you can query the DOM and retrieve an array of elements to pass to setStyle()
, as shown below:
var els = YAHOO.util.Selector.query('h1, h2, h3, .some-element');
YAHOO.util.Dom.setStyle(els, 'color', 'red');