You will see that on clicking divA , divAA will slide down. on clicking divB, divBB will slide down.
After clearing the main DIV and appending the same contents again, the accordion stops working as shown in this demo: http://jsfiddle.net/p7vUk/2/
Can somebody please explain why it stops working and how to fix it?
Your problem is the fact removing the original DOM objects that the accordion functionality attached itself to. Just because you add new ones doesn’t mean its the same thing. They are entirely new elements, and because of that you have to run the accordion functionality on them again.. Thats about as dumbed down as I can make it sound.
So try this..
if that last new line doesn’t work try this instead