How to retrieve id from a heading and apply it as collapse class to non-headings