Is there an easy way to set up collapse and expand Quick Launch headings in Sharepoint Online?
Do you know of any good javascript that would accomplish this and where to put the code? I think it would be called a javascript injection (rather than customizing the default masterpage which I think would cause the code to be overwritten with any MS upgrade to sharepoint online).
Marc has some code for classic SharePoint http://sympmarc.com/2015/05/27/simple-expandcollapse-for-the-quick-launch-in-sharepoint-2013-or-sharepoint-online/
I don’t have one on hand for Modern. But you are correct, you would use javascript injection. For classic, you’ll inject it. For Modern, you’ll use an application customizer to inject it.