Selector and target with matching numerical IDs?

Selector and target with matching numerical IDs?

I hardly know how to ask this question, which is why Google hasn't been any help.

I have five anchor tags with the id's "detail1" through "detail5." Clicking on any of them hides or shows the proper div among five divs with the id's "callout1" through "callout5." Right now I have this written as inline jQuery and it's working just fine...but in trying to turn it into a function, I'm stymied.

I wonder if there is an efficient way to do something like what's below. This is a mix of jQuery syntax and plain language -- the whole point is, I don't know what to replace the plain language with:

  1. $('#detail+particular number').click(function() {
  2.         $('.callout').hide();
  3.         $('#callout+identical number as selector').show();
  4.         return false;
  5.     });