Is a simple example of a toggle button.
You need to start with the input button and then get the state of this

Then add the type and id and style.
You can remove the text-indent: -9999px; and Toggle button if you don’t want to see text to this toggle button.
Let’s see the full source code and how is working.
The part after hr tag with button and paragraph tag id=output is just for tested the toggle button.
You can make an HTML file and put this source code to test it.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Translate »