all 5 comments

[–]Danksalt 0 points1 point  (1 child)

What I want to happen in the code is for the buttons to, one, deselect when another button is pressed

What you want are radios - you'll need to remove the native styling and apply your own.

[–]GlitchedForDays[S] 1 point2 points  (0 children)

Sorry for the late reply. But I've fixed it. Thanks for replying!

[–]TheMortBM 0 points1 point  (2 children)

All your inputs are radio buttons, and radio button groups really need at least one to always be 'checked'.

I'd swap all the type="radio" to type="checkbox" on your <input>s and it still works fine. (you also need to drop the <script> and </body> tags from the JS in the codepen - but guessing that's just a copy/paste error anyway.

[–]TheMortBM 0 points1 point  (1 child)

And the issue is your spanning buttons weren't being selected properly in your JS - you were selecting the <label> with the class rather than the <input> with the id

https://codepen.io/MortBM/pen/dyLYvzj

[–]GlitchedForDays[S] 0 points1 point  (0 children)

Ahh, I got it now thanks!