Pass a variable id to click

Pass a variable id to click

Hello,
I'd like to use this as a general function to pass id's to the selectors(represented now by #A and #B). The id's are variable, so if i click the element with id=A it knows to change element with id=D, ect. , But more importantly, I'm not sure how to pass the id's to the click(). I certainly dont want to write a click for each element.

$(document).ready(

function ()

{

$(

"#A" ).click( function () {

$(

'#B' ).text( 'Blah' );

});

});

Thanks for all your help,