views:

42

answers:

1

I want to create a list that is actually a list of collapsible divs on my site. So when you click on an item on the list, more information will become visible.

I'm using animatedcollapse from http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

The problem is that since I'm looping over divs, they all have the same id, and thus 'opening' any of the divs will open all of the divs.

Should I make unique id's for every div? How is it done?

Thanks a lot for your help. I'm using Django.

A: 

id's in an html page should always be unique. When you're looping, you can append the loop index to your id, to make it unique.

Scharrels
Thanks!I'm not yet sure how to reference these from my javascript but I guess I'll be able to do that with a for-loop in the javascript.
Riku