I think you should
<div></div> your entire set
of accordion, instead of calling function for each element.
than either use
data- on each link to select which sections
to open. ( or use
This way you have a wrapper and now u can simply call
; before opening
If you must go with using variable and boolean expression, look into sessionStorage.
probably something like
note you need supported browser.