I want to toggle a bunch of divs that each have the same id.
My current jquery code only toggles one div.
(I’ve tried using a mixture of .next and .parent.next, but haven’t found anything yet)
$('#body'+id).toggle('400');
So: There would be multiple divs with a '#body2010' id. I want to toggle all of those.
Duplicate ID names are invalid. You should convert them to classes. jQuery will only match the first matching element for ID tags whereas it would return an array of all class matches. You would then do: