Applying the same function to two elements

Applying the same function to two elements

Hi,

How can I apply the same jQuery function to two different elements.
I tried this, but it doesn't work:

  1. slideFade($('.messages.status'), $('messages.error'));

Why it's not working?
I know that it works this way:

  1. slideFade($('.messages.status'));
  2. slideFade($('.messages.error'));

But is this the right way to do it?

Thanks