Working with divs created at runtime

Working with divs created at runtime

I am creating a series of buisiness card type presentations on a web page.  Each “card” has the usual business info populated from a database.  I have PHP that loops through the recordset and HTML as follows to create each of the cards with each loop. In addition to the business card there is a div that will have additional business information that will be hidden initially from the user.  “ButtonA” will use some JQuery to slide that information into view or out of view as the user decides. There will be hundreds of these cards when complete.  My question is how when pressing ButtonA do I pass a variable to the JQurey code so it knows which div to slide up or down.  I am appending the  record’s index to  the “moreBusStuff” class for the div (moreBusStuff22) so those are unique but have no idea how to affect the same change with the $(“#moreBusStuff”) in the JQuery.

 

Any help would be appreciated.

Jim

 

<?php do{?>

<div class=outter>

 

<div class=bCard>

<table>

Business Card Stuff

ButtonA id=”moreStuff”

</table>

</div>

 

<div class=moreBusStuff>

Details of business

</div>

</div>

 

<?php } while (there is something remaining in the dbase table); ?>

 

$("#moreStuff").toggle(function(){

             $(this).text("Show More");

             $(“#moreBusStuff”).slideDown();

             },function() {

             $(this).text("Show Less");

             $(“#moreBusStuff”).slideUp();

            

});