I want to add a function to this HTML and CSS code.
HTML
<div class="switch">
<input name="sincro" type="radio" checked="checked">
<label>O</label>
<input name="sincro" type="radio">
<label>I</label>
</div>
CSS
.switch {position:relative; overflow:hidden; border:1px gray solid; background-color:white; }
.switch label {position:relative; z-index:2; float:left; width:50%; height:100%; -webkit-transition:all 0.1s ease-out; -moz-transition:all 0.1s ease-out; transition:all 0.1s ease-out; background-color:gray; }
.switch input {position:absolute; z-index:3; opacity:0; width:100%; height:100%; -moz-appearance:none; }
.switch input:hover, div.switch input:focus {cursor:pointer; }
.switch input:checked {display:none; }
.switch input {display:block; }
.switch input:first-of-type + label {left:-50%; }
.switch input:first-of-type:checked + label {left:0%; }
.switch input:last-of-type + label {right:-50%; left:auto; background-color:green; }
.switch input:last-of-type:checked + label {right:0%; left:auto; }
In practice, I would keep graphically the function that simulates the ON and OFF of the button and implementing the functionality to show and hide one DIV with a specific ID="".
I tried with only CSS or with javascript but it doesen't work completely because if works the simulation of the botton the hide and show doesn't work...Help please!!!