.toggle-switch input[type=checkbox] {
display: none
}
.toggle-switch label {
cursor: pointer;
}
.toggle-switch label .toggle-track {
display: block;
height: 10px;
width: 85px;
background: #eee;
border-radius: 20px;
position: relative;
margin-bottom: 5px;
border: 1px solid #ccc;
}
.toggle-switch .toggle-track:before{
content:'';
display:inline-block;height:18px;width:18px;background:blue;
border-radius:20px;
position:absolute;
top:-5px;
left:0;
transition:left .5s ease-in;
}
.toggle-switch input[type="checkbox"]:checked + label .toggle-track:before {
background:green;
left:70px;
}
<div class="col-12">
<div class="row">
<div class="col-3 col-md-3" >ENABLE</div>
<div class="col-3 col-md-3">
<div class="toggle-switch">
<input type="checkbox" id="chkTest" name="chkTest">
<label for="chkTest">
<span class="toggle-track"></span>
</label>
</div>
</div>
<div class="col-3 col-md-3">DISABLE</div>
</div>
</div>
The color of text changing according to the witching toggled button. When it click on toggle button text color will change according to the switch button color is changing the text color will change too.