Collapsible Hide/Show DIV

Hi there. I posted this before but wanted to change the subject. I
want to have a collapsible div inside of a for loop. I’ve been messing
around with it and could only get 1 item out of a few to be able to
hide. I’m just using this:

Now, I have for example a major category, with many items in that
category. What I want to do is, show the category name, but under this
category, hide the related items. This is done is one loop since I have
a HASBTM relationship. For example then in pseudo code:

for each cat in cateogry /possible cats are kitchen, living room,

div ...etc /div
Kitchen (show more)
knife $3.00 Buy Now Spatula $5.00 Buy Now

I want to do something like this. Any help would be nice