I am attempting to incorporate a toggle switch into my webpage. I followed this specific tutorial for guidance:
Currently, I have set up my HTML file with a button and the toggle switch. Additionally, I configured my web server in Go to listen on localhost:8080. With a websocket handler in place, data can be easily transmitted to my webpage upon button click.
My intention is to create a toggle switch on the webpage that users can turn on and off, then click a button. Following the button click, I aim to analyze the user's selection using an if condition in my Golang code based on the status of the toggle switch. However, I am struggling to find a way to access this value in Go. Any suggestions would be greatly appreciated. While implementing a toggle switch would be ideal, alternative straightforward ideas for this scenario are welcome as well.