How to play random audio file which matches certain rules❓ [Won't take you script masters much time!]

Thanks in advance! I’ve searched and tried but failed to solve it by myself. I would really appreciate if you could take a look at my request!
All I want is to have one of the example audios played randomly on the frontside. And the audio comes from a section named glossary_audio which is linked to a field named glossary1.
I have got a hint from the discussion here and pasted the script at the bottom of my Front Template: JS Random soundfiles / TTS voices & playback speed - #15 by julienvincenot , but I got another issue.

I uploaded a .apkg file for you to test:

And the issue is described as below:

─────────Another Request──────────
If it’s not too much trouble, can you also tell me the code to change background color of the selected audio button? (for section “Glossary Audio”) Like this:https://www.reddit.com/r/Anki/comments/b3e6k3/comment/eizm4ci/?utm_source=share&utm_medium=web2x&context=3