When clicked, it changes the value to false , but not back.
I think the problem is in the type of the value, it is a string . How to remake on boolean ?
button { border: 0px; border-radius: 2px; outline: none; padding: 4px 8px; cursor: pointer; color: #FFF; transition: .5s; } button[value='true'] { background: #63AEEE; } button[value='false'] { background: #FF6040; }
<button onclick='value = !value' value='true'>Toggle</button>